I was hoping to avoid using my own storage, but it seems not too feasible. I will subclass it and see how it turns out, thanks all.
c s
Posts
-
checkbox check problem -
checkbox check problemI have tried using BS_AUTOCHECKBOX with BS_OWNERDRAW (I do draw them myself so I need that) but it doesn't seem to have an effect, and BM_GETCHECK still always returns 0.
-
checkbox check problemhTempWnd = CreateWindowEx (
0, // no extended style
"Button",
"Compression", // toggles chunk compression
WS_VISIBLE | WS_CHILD | BS_OWNERDRAW, // make a visible child window, that we draw ourself (see void DrawCheckbox)
clientRect.right - MM_DBUTTON_WIDTH - MMPADDING_RIGHT, // create it near the top right corner
clientRect.top + MMPADDING_TOP + MM_GROUPPADDING_BOTTOM,
MM_DBUTTON_WIDTH, MM_DBUTTON_HEIGHT, // use our standard checkbox button height and width
hWnd, // our parent window is this popup menu
(HMENU) MMENU_BUTTON_COMPRESSION,
GetModuleHandle ( NULL ),
NULL // pass no extra parms on creation
) ;LPDRAWITEMSTRUCT lpdis from lParam in WM_DRAWITEM
long lResult = 0;
lResult = SendMessage ( lpdis->hwndItem, BM\_GETCHECK, (WPARAM) 0, (LPARAM) 0 ) ; if ( lResult == BST\_CHECKED ) ...
When I was trying BM_GETIMAGE I used the same procedure as the second code snippet edit: It seems that BM_GETCHECK and BM_SETCHECK just don't work with ownerdraw, so that solves that issue, but I'm still unsure why BM_SETIMAGE doesn't work.
-
checkbox check problemI am a beginner in the windows programming world, and am having a bit of trouble figuring out how to determine the state of my checkbox when it's ownerdraw. If I use BM_GETCHECK it always returns 0, even if I send BM_SETCHECK a line above passing BST_CHECKED. I also tried ORing BS_CHECKBOX and/or BS_AUTOCHECKBOX with BS_OWNERDRAW but BM_GETCHECK still returned 0. I then attempted to use BM_SETIMAGE as general storage (a pointer) but BM_GETIMAGE always returns 0 as well. Is it due to the fact my checkboxes are ownerdraw, or is there some other problem I'm unaware of? thanks
-
window enumeration from pidIs there a way to enumerate the windows of an application from it's process id? thanks
-
windows hicon problemthanks, but that isn't my problem. It will probably helpful if I explain what I want to do. I have an animated icon 12 frames long, I also want it to change color depending on what the application is doing, however I don't want to end up making 76 different icons. I need to access the pixel data so I can overlay a color with 3dnow and mmx, so I need access to the actual memory or load the icon myself and if possible, set the data up the same way the data is set up that a HANDLE points to, and point my HICON at it.
-
windows hicon problemMy application uses a tray icon (Shell_NotifyIcon) and I need to access the data of my icon displayed. Does anyone know what a HICON points to and how to manipulate the icon data, or simply after loading an icon yourself, using that in the tasktray or converting it to a HANDLE windows can use? thanks
-
Software Is Not Like Cheesehaha, today is going to be great
-
Digging through a box and I foundHaha, I feel like one too, I'm 16 and I'm reading a book that had a full 8 chapters or so on how to optimize assembly for the 8088!! Did you ever use punch cards? Or was that further back in the mid-late 70s?
-
Linking to C++I have created a few procedures in assembly that I want to be C++ callable. I also want to be able to give arguments. I am using Masm as my assembler and Visual C++ as my compiler. I already know that I need to append a _ to my functions. I also seem to remember _pop_ing things off the stack for parameters, but I don't know for sure. An example is a procedure: _Out I want it to take a byte as one parameter and a word as the next, and then I want to be able to call it from a C++ program that it is somehow linked to. (I don't know how to do that either) How would I go about doing this? Thanks
-
C++ Arrow KeysI have taken a look at that, but this time I noticed I need to give my view the keyboard focus (how can I do this?). Thanks. Though I'm still not sure how to detect multiple arrow key presses at once, I tried getting the flags with "ah 12h, int 16h" but that only returns flags that hold shift,ctrl,insert,etc. So how do I detect that two (or more) arrow keys are being pressed at once?
-
C++ Arrow KeysFor a windows program I am making I need to detect arrow key presses. Now I have a switch statement: switch(nChar) { case VK_DOWN: // do stuff break; case VK_RIGHT ... } but I need to detect if multiple arrow keys are being pressed at once, how can I do this? (my OnKeyDown handler no longer does anything when a key is pressed. I'm not sure but it might be it doesn't have the focus, though I actually have no idea. Any ideas on that?) Any help is greatly appreciated. Thanks.