[Solved] Windows GUI – Find out what has been clicked on the screen

There are several programs on the web which do this. IIRC winspy is one of them. It achieves this via setting a global mousehook which returns the programname of the clicked window. How to absract this in JNI? Do not know, but this is the link, you asked for: http://www.codeproject.com/Articles/1037/Hooks-and-DLLs 4 solved Windows GUI – … Read more

[Solved] WIN32 : PictureBox Does Not Display Picture

The following code sample works for me on Windows 10 (SHLoadDIBitmap API seems not valid for Windows 10. I use LoadImage API instead.). You can refer to. C++ code in dialog box procedure: case WM_INITDIALOG: hImage = LoadImage(NULL, L”full_path_to\\image3.bmp”, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE); if (NULL == hImage) errCode = GetLastError(); hwd_static_img = GetDlgItem(hDlg, … Read more

[Solved] How come GetDefaultCommConfig fails on windows 10

This had been a bug in usbser.sys and was fixed with the Windows 10 Update KB3124262 from 27.01.2016. The Microsoft employee explained: The COM port name in the HKLM\HARDWARE\DEVICEMAP\SERIALCOMM registry is not NULL terminated. Related discussion on MSDN Because of Windows 10’s update policies this issue should not appear in the future anymore. solved How … Read more

[Solved] Any example to use RegLoadKey()

Thanks a lot for your time. Going to share the code that I used; It may help someone else: #include <windows.h> #include <stdio.h> BOOL SetPrivilege( HANDLE hToken, // access token handle LPCWSTR nameOfPrivilege, // name of privilege to enable/disable BOOL bEnablePrivilege // to enable or disable privilege ) { TOKEN_PRIVILEGES tp; LUID luid; if (!LookupPrivilegeValue( … Read more

[Solved] Unable To Change Menu Bitmap

My Bad! I forgot to declare hMenu as a static variable. Because of that, I was losing my menu handle. That’s why SetMenuItemInfo() would not work later, in the command code blocks. I knew that it had to be something simple. Anyway, here are the final bits of code. First, the creation of the Max/Restore … Read more

[Solved] Title Name not showing and background color not changing

Your MessageRouter is missing default processing. Add DefWindowProc as shown LRESULT CALLBACK AbstractWindow::MessageRouter ( HWND hwnd, UINT message, WPARAM w_param, LPARAM l_param ) { AbstractWindow* abstract_window = 0; if ( message == WM_NCCREATE ) { abstract_window = ( AbstractWindow* ) ( ( LPCREATESTRUCT ( l_param ) )->lpCreateParams ); SetWindowLong ( hwnd, GWL_USERDATA, long ( abstract_window … Read more

[Solved] Dock/Anchor alternative in C++ for List Control

There is no docking support in the Windows API. You’ll have to implement it manually by handling the WM_SIZE message: case WM_SIZE: { UINT width = LOWORD(lParam); UINT height = HIWORD(lParam); // IDC_LIST1 will occupy the entire client area of its parent. // Adjust as needed. MoveWindow(GetDlgItem(hWnd, IDC_LIST1), 0, 0, width, height, TRUE); return TRUE; … Read more

[Solved] Hide all traces of a program that is running [closed]

I am no expert but I think most techniques that deals with process hiding uses CreateRemoteThread.http://msdn.microsoft.com/en-us/library/windows/desktop/ms682437(v=vs.85).aspx It is pretty tough to get right, but there are maaany blogs about it, eg:http://resources.infosecinstitute.com/using-createremotethread-for-dll-injection-on-windows/ This works by picking some victim process that is already running, like say svchost.exe and add your thread into this. Also while speaking of … Read more

[Solved] How to make SendMessage unblocking?

You can’t make win32api.SendMessage() non-blocking because the underlying Windows function is blocking. Instead you can use win32api.PostMessage(), it has the same signature: import win32api, win32con print “start” win32api.PostMessage(win32con.HWND_BROADCAST, win32con.WM_SYSCOMMAND, win32con.SC_MONITORPOWER, 2) print “end” 3 solved How to make SendMessage unblocking?

[Solved] Array String null

sizeof(item[0].stringArray) in your code is the size of the string pointer, not the size of the space you set. You can try this. In additon, you should pay attention to the size of your array, otherwise you will always right-click the size of the array, can cause array crossing bounds, causing program errors. solved Array … Read more

[Solved] computing hashValue of a file

The problem is you declare resultstream as CHAR resultstream[33]; but then you use in your code resultstream[33] = ‘\0’; The resultstream array is 0 indexed so valid values are 0-32, you are accessing memory not allocated for that array (hence the “Access violation”) 0 solved computing hashValue of a file