winapi

No module named 'win32api' // PY2EXE

给你一囗甜甜゛ 提交于 2021-02-17 05:54:25
问题 I am using Python 3.6.7 in conda 4.5.12 (Win10,64bit) and I want to compile my Python project to an .exe-File using Pyinstaller (3.5 dev). I keep getting the same error: ModuleNotFoundError: No module named 'win32api' [65600] Failed to execute script pyi_rth_win32comgenpy I already reinstalled pywin32 as recommended in 25314463, the import of win32com works. I also tried: pip install pypiwin32 as described in 21343774. The Installation was successful. But I still get the same Error. pip

Error 998 (Invalid access to memory location) for when calling GetPointerFrameTouchInfo [duplicate]

浪尽此生 提交于 2021-02-17 05:52:25
问题 This question already has answers here : WriteConsole access violation in function call but not from main() (2 answers) Closed 3 years ago . I am trying to call the GetPointerFrameTouchInfo function to get the pointer count but the function seems to fail with Error 998 (Invalid access to memory location). Any idea why that is happening and how I can resolve it? I am trying to call the same inside the hook procedure GetMsgProc as mentioned below: LRESULT WINAPI GetMsgProc(int nCode, WPARAM

WINAPI EnumWindowsProc: Non-Standard Syntax; use & to create a point to a member

可紊 提交于 2021-02-17 04:44:10
问题 I keep getting an error when I call EnumWindows(EnumWindowsProc, 0); Which converts my BOOL CALLBACK selectionWindows::EnumWindowsProc(HWND hWnd, long lParam) function into a parameter. I know it has something to do with the classes and selectionWindows:: but I can't figure it out for the life of me. Here is the .h #ifndef SELECTIONWINDOWS_H #define SELECTIONWINDOWS_H #include <windows.h> #include "mainwindow.h" #include <QWidget> #include <iostream> class selectionWindows : public QWidget {

WINAPI EnumWindowsProc: Non-Standard Syntax; use & to create a point to a member

筅森魡賤 提交于 2021-02-17 04:43:27
问题 I keep getting an error when I call EnumWindows(EnumWindowsProc, 0); Which converts my BOOL CALLBACK selectionWindows::EnumWindowsProc(HWND hWnd, long lParam) function into a parameter. I know it has something to do with the classes and selectionWindows:: but I can't figure it out for the life of me. Here is the .h #ifndef SELECTIONWINDOWS_H #define SELECTIONWINDOWS_H #include <windows.h> #include "mainwindow.h" #include <QWidget> #include <iostream> class selectionWindows : public QWidget {

Python27 - on windows 10 how can i tell printing paper size is 50.8mm x 25.4mm?

主宰稳场 提交于 2021-02-16 21:00:29
问题 I have this code on windows which is working with A4 printers. But i have a very small printer, when i print something it does not print anything but only push the ticket out. TRY0: import win32ui X=0; Y=0 input_string = "Print 1234 test" multi_line_string = input_string.split() hDC = win32ui.CreateDC () hDC.CreatePrinterDC ('Dymo label printer') hDC.StartDoc ('FILE NAME FILE NAME') hDC.StartPage () for line in multi_line_string: hDC.TextOut(X,Y,line) #Y += 100 hDC.EndPage () hDC.EndDoc ()

Python27 - on windows 10 how can i tell printing paper size is 50.8mm x 25.4mm?

五迷三道 提交于 2021-02-16 20:58:07
问题 I have this code on windows which is working with A4 printers. But i have a very small printer, when i print something it does not print anything but only push the ticket out. TRY0: import win32ui X=0; Y=0 input_string = "Print 1234 test" multi_line_string = input_string.split() hDC = win32ui.CreateDC () hDC.CreatePrinterDC ('Dymo label printer') hDC.StartDoc ('FILE NAME FILE NAME') hDC.StartPage () for line in multi_line_string: hDC.TextOut(X,Y,line) #Y += 100 hDC.EndPage () hDC.EndDoc ()

Im trying to use OpenGL with the windows API on different threads

和自甴很熟 提交于 2021-02-16 20:34:19
问题 So basically I am using the windows api to create an emty window and then I use OpenGL to draw to that window from different threads. I managed to do this just with one thread , but getting and dispatching system messages so that the window is usable was slowing down the frame rate I was able to get, so I'm trying to get another thread to do that in parallel while I draw in the main thread. To do this I have a second thread which creates an empty window and enters an infinite loop to handle

How to handle “End Task” from Task Manager in .NET 5 console app?

故事扮演 提交于 2021-02-16 14:48:07
问题 My .NET 5 console application registers a HandlerRoutine by using SetConsoleCtrlHandler, so it can do some cleanup before exiting. This allows me to react to CTRL+C / CTRL+BREAK , ALT+F4 and the console being closed using the X button. Sadly, the HandlerRoutine doesn't get called when Task Manager tries to terminate the application after clicking End Task in the Process tab, even though the documentation for HandlerRoutine states the following regarding CTRL_CLOSE_EVENT : A signal that the

How can I load the same icon as used by MessageBox on Windows 10?

倾然丶 夕夏残阳落幕 提交于 2021-02-15 05:10:15
问题 On Windows 10 calling LoadIcon asking for the standard icon IDI_INFORMATION yields this icon: On the other hand, calling MessageBox passing IDI_INFORMATION produces a dialog that uses this icon: How can I obtain the second icon, if the obvious call to LoadIcon does not do so? 回答1: This feels like a bug in user32.dll but Windows 8 has the same issue so I guess Microsoft doesn't care. You can get the flat icon used by MessageBox by calling SHGetStockIconInfo: SHSTOCKICONINFO sii; sii.cbSize =

How can I load the same icon as used by MessageBox on Windows 10?

两盒软妹~` 提交于 2021-02-15 05:09:55
问题 On Windows 10 calling LoadIcon asking for the standard icon IDI_INFORMATION yields this icon: On the other hand, calling MessageBox passing IDI_INFORMATION produces a dialog that uses this icon: How can I obtain the second icon, if the obvious call to LoadIcon does not do so? 回答1: This feels like a bug in user32.dll but Windows 8 has the same issue so I guess Microsoft doesn't care. You can get the flat icon used by MessageBox by calling SHGetStockIconInfo: SHSTOCKICONINFO sii; sii.cbSize =