FAQ Database Discussion Community


Tab Control: How to prevent the selection from changing?

c++,winapi,tabs,tabcontrol,win32gui
My project is simple WIN32 dialog box with a tab control. Under some condition, I want to prevent the user from changing tab. MS documentation is quite straightforward - Returns TRUE to prevent the selection from changing, or FALSE to allow the selection to change. However, this just does not...

How to get the default caption bar height of a window in Windows?

windows,winapi,win32gui
I am developing an application which employs a self-drawn titlebar, which needs to mimic the system default titlebar. So how could I get the default titlebar height of an overloapped window in Windows?...

Setting button icon using C with raw Win32

c,windows,winapi,win32gui
I'm building a GUI with some simple dialogs using raw Win32 API with pure C (no MCF). In one of those dialog I'd like to display a button with an icon (a small folder) instead of a text. I prepared a .ico file with the proper size (16x16 pixel) and...

Using image instead of default + and - signs in tree view

winapi,treeview,win32gui
I am developing a win32 application and I want to use my own images instead of default + and - signs in tree view. I also found here that I can use images in four cases- 1)An image, such as an open folder, displayed when the item is selected. 2)An...

No restore button in maximised window

win32gui,mdichild
When I maximise one of my mdi client windows. I am then stuck with it maximised, I need to be able to restore it to view the other windows. WNDCLASSEX wc; wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; wc.lpfnWndProc = CWindowHandler::MsgRouter; wc.cbClsExtra = 0; wc.cbWndExtra = 0;...

gdi+ PrivateFontCollection AddFontFile always returns status with “InvalidParameter”

c++,fonts,gdi+,win32gui,typeface
every one, I'm using GDI+ to rendering text with my own typeface, but I always get a error status InvalidParameter when using member function AddFontFile(WCHAR*) of PrivateFontCollection to load my font file, here is my code: PrivateFontCollection m_font_collection; ... // initialize window GdiplusStartup(&gdi_token, &gdi_startup_input, NULL); // here the result always...

Hooking local WndCallback using SetWindowLong: ACCESS DENIED

visual-c++,visual-studio-2013,x86,hook,win32gui
I'd like to locally hook my WindowProc function. First I was thinking of SetWindowsHookEx, but I wouldn't like to have an external DLL only for this hook. I'd like to make it internally and locally (I don't want a global hook). That's why I came across with SetWindowsLong. I'm trying...