[Solved] How to create multiplethreads each with different ThreadProc() function using CreateThread()

Try this: DWORD WINAPI ThreadProc1( LPVOID lpParameter) { … return 0 ; } DWORD WINAPI ThreadProc2( LPVOID lpParameter) { … return 0 ; } … typedef DWORD (WINAPI * THREADPROCFN)(LPVOID lpParameter); THREADPROCFN fntable[4] = {ThreadProc1, ThreadProc2, …} ; //Start the threads for (int i = 0; i < max_number; i++) { DWORD ThreadId ; CreateThread( … Read more

[Solved] Why the C++ code couldn’t display bitmap?(code from textbook) [closed]

Running your code, put aside the code logic first, just to show the BMP image, you did not add the correct image path. You can try to add the absolute path of the picture. Like this: DrawBitmap(“C:\\Users\\strives\\source\\C.bmp”,x,y); //This is my picture path. Please enter your picture path correctly. Updated: I retested the code with MinGW, … Read more

[Solved] DLLImport of the origin function in the DLL

If only kernel32.dll is being changed you could call ntdll.dll!NtReadVirtualMemory (ReadProcessMemory itself calls this function). If ntdll.dll is also seems to be changed by 3rd party process you could copy ntdll.dll to another temporary file (ntdll_copy.dll), and use it: [DllImport(“ntdll_copy.dll”, EntryPoint = “NtReadVirtualMemory”)] private static extern bool NtReadVirtualMemory(IntPtr hProcess, UIntPtr lpBaseAddress, [Out] byte[] lpBuffer, UIntPtr … Read more

[Solved] stopping a thread in windows [closed]

Using the TerminateThread function. The function you posted does: PostThreadMessage(hookThreadId, WM_QUIT, (WPARAM) NULL, (LPARAM) NULL); WaitForSingleObject(hookThreadHandle, 5000); So it sends a quit message to that thread, and then waits for it to close. 6 solved stopping a thread in windows [closed]

[Solved] Start child process process inside parent process

Is it possible to start a child process inside same address space? I would like to access any exported function localy. No, it’s not possible. The operating system creates a new address space for each process, that is protected to be accessed from other processes. Use threads instead. 9 solved Start child process process inside … Read more

[Solved] Show Yes/No messagebox where No is grayed out win32api C++ [closed]

Use SetWindowsHookEx() or SetWinEventHook() with a thread-local hook to capture the MessageBox() dialog’s HWND, then you can use EnableWindow() to disable the button. Here is how to do it using SetWindowsHookEx(): HHOOK hHook = NULL; LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) { if( nCode == HCBT_ACTIVATE ) { HWND hDlg = (HWND) wParam; … Read more

[Solved] Show Window specific JumpList in Windows

Windows uses the Application User Model ID to group taskbar buttons and jump lists. This lets you group multiple processes together, or in your case split multiple windows from the same process. You can assign a different AppUserModelID to a window by using the SHGetPropertyStoreForWindow() function to obtain the window’s IPropertyStore interface and then set … Read more

[Solved] WINAPI IsWindow return false [closed]

Are you sure you have the correct handle value? Assuming your thread is on the same desktop as the other window it is guaranteed to work correctly. If it returns false then the HWND is not valid because A) your HWND variable contains a numerical value that is not a valid HWND, or B) timing … Read more

[Solved] Unexplainable bug in my code

There are several issues with your code (using legacy APIs, using bad parameters, missing logic, etc). Try something more like this instead: #include <iostream> #include <Windows.h> const DWORD transparenton = 0x00000001; const DWORD transparentoff = 0x00000000; using namespace std; void pause(); void act(HKEY key); bool getTransparency(HKEY key, DWORD &value); void setTransparency(HKEY key, DWORD value); int … Read more