Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

Ron Waller

@Ron Waller
About
Posts
4
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Generating pure randomness with a PC
    R Ron Waller

    I'm wondering if it is possible to generate pure randomness with a typical PC. I'm thinking there might be hardware within the PC that runs at different clock frequencies with electronic variances that can be used to generate a stream of pure randomness.

    Hardware & Devices hardware

  • Quick and dirty C++ managed memory
    R Ron Waller

    Why not have the "new" operator return a typed handle when you get memory on the heap (if you want it to)? And then use a "lock" operator to get a pointer to the memory, and the pointer is only valid within the scope of the function. Then on idle time, all memory is unlocked and can be compacted. I wonder if there is a way of doing this by overiding the global new and delete operators and somehow checking for handle types? In any case I think it would be better if the compiler was in on the action. For instance you could declare a handle: char* # hString; hString = new char[80]; char* pString = lock hString; strcpy( pString, "A String"); int len = strlen( pString ); And when you want to free the memory: delete [] hString; And when calling a member function: CThisObject* # hThis = new CThisObject( data ); if( hThis ) hThis->DoThat(); is the same as: CThisObject* # hThis = new CThisObject( data ); if( hThis ) { CThisObject* p = lock hThis; p->DoThat(); } In any case, I'm sure die-hard C++ programmers would prefer managed memory along these lines instead of all the crap you have to deal with in .NET managed C++.

    C / C++ / MFC csharp c++ performance question

  • Skinning menus and undoc'd menu msgs
    R Ron Waller

    I was wondering if any has info on the undocumented menu control messages, similar to the button messages: BM_CLICK, etc. I found a really simple way to subclass the menu by changing its windows-class wnd proc. First create an invisible menu window with the class name of "#32768" called from the CMainFrame's OnCreate, using it as a parent: hwnd = CreateWindow( "#32768", "", WS_CHILD, 0,0,10,10, pParent->m_hWnd, (HMENU) 0, AfxGetInstanceHandle(), &cs ); Then replace the window-class wnd proc with your own: s_OldWindowProc = (WNDPROC) SetClassLong( hwnd, GCL_WNDPROC, (DWORD) WindowProc ); Then destroy the window because you don't need it anymore - all menus in your app have the same class wnd proc. In your "WindowProc" you send all the messages to the orginal class proc using CallWindowProc(). Here are the messages and what they seem to do: 0x000001E5: -Draw mouseover item and send statusbar msg. 0x000001EF: -Send out the command msg 0x000001E4: -End of popup menu 0x000001ED: -Process lbuttondown, draw pressed item, send statusbar msg 0x000001EB: -Handles when to send the command and terminate the popup Now I think I have enough to override all the drawing so I can replace it with my own, while maintaining full menu functionality, even though I have to use LockWindowsUpdate() to prevent drawing on 0x01E5 and 0x01ED, while calling the orginal proc. But it would be great to get the message names and the info they have in the Params, which would make skinning the menus a lot easier. Any help or info on where I can this information would be greatly appreciated. BTW, thanks to .dan.g. and his orignal article on the subject for a lot of the information: http://www.codeproject.com/menu/skinmenu.asp

    C / C++ / MFC com graphics help

  • When to draw the focus rectangle
    R Ron Waller

    How do you know when you are supposed to draw the focus on a control? I'm referring to controls on dialog boxes. At first when you click on a control with the mouse, the control doesn't draw the focus rectangle. It only draws it once you start navigating the dialog with the keyboard. I'd like to be able to find out from within the control using its hWnd. (I'm trying to skin Win98-style buttons in VC++ 6.0 to give them a WinXP look by overriding drawing messages [WM_PAINT, BM_SETSEL, etc.] in the button's windows-class wnd proc. I've got everything done so far, except this, and I've spent hours searching MSDN and the internet trying to find it.)

    C / C++ / MFC c++ graphics algorithms question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups