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
J

John Saunders

@John Saunders
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • OnNcPaint blocks XP visual styles
    J John Saunders

    Yes you are right :-D I have confirmed that it is the drawing part of OnNcPaint that is stopping the visual style. Since I do my drawing after the default window processing completes, Windows must work out that I will be calling DrawFrameControl in the future and then render using the old Windows 2000 style. I think all I have to do now is replace DrawFrameControl with some theme based drawing when running on XP. I have just added to code to load the uxtheme.dll library and get pointers to theme functions I need to call. I think I just need to do the following with appropriate parameters to draw my icon... if (uxthemeloaded) { pOpenThemeData(...); pGetThemeBackgroundContentRect(...); if (pIsThemeBackgroundPartiallyTransparent(...)) { pDrawThemeParentBackground(...); } pDrawThemeBackground(...); pCloseThemeData(...); }

    C / C++ / MFC wpf regex help question

  • char[n] to int ?
    J John Saunders

    int length = (int)version[0]; cout << "value should be 24 <" << length << ">" << endl;

    C / C++ / MFC help c++ ios tutorial question

  • TCHAR Conversions from char*
    J John Saunders

    Place the macro USES_CONVERSION at the beginning of your function. You then have access to all of the string conversion macros. You can convert between any of ACSII (A), OLE (OLE), WIDE (W)and TCHAR (T). To convert ASCII to TCHAR do the following. LPSTR *lpSrc; LPTSTR *lpDest = A2T(lpSrc); Similarly T2A, A2W, W2A, A2OLE, etc can be used. You can also put a C after the 2 to get a const string returned. The good thing about these macros is that if you build the application with _MBCS defined, TCHAR is the same as ASCII so the A2T macros becomes nothing. If you build with _UNICODE defined then it will allocate a buffer and covert to Unicode for you. The memory is allocated on the stack with _alloca, so you can't keep the converted string after the function returns without taking a proper copy of it first. Also don't use inside a loop because it could allocate a lot of memory if the loop iteration is large.

    C / C++ / MFC question data-structures help tutorial

  • OnNcPaint blocks XP visual styles
    J John Saunders

    I have an application that places a custom button on the window caption bar. However I am having a problem when running on Windows XP. I am finding that simply handling the WM_NCPAINT message causes XP to render the caption bar with the old Windows 2000 style. If I comment out ON_WM_NCPAINT() in the message map the caption bar is then drawn with the current XP style, put it back and the Windows 2000 style is used. To make matters worse GetSystemMetrics returns caption icon sizes that match the XP theme, even when it is rendering the Windows 2000 style. This means I have no way of calculating the icon size and position. I feel like I am trapped, I can't have the XP style because handling WM_NCPAINT automatically disables it, and I can't have the Windows 2000 style because GetSystemMetrics won't tell me the correct sizes. How does Microsoft expect people to now put icons on the caption bar? Has anybody put a custom icon on the caption bar of XP and retained the themed style, how did you do it? P.S. Popup dialog windows are render with the XP style regardless of what I do with the main window.

    C / C++ / MFC wpf regex help 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