[Dev-C++] Res: [C/C++][Windows XP][GUI] CreateWindowEx()/CreateWindow() does not create buttons wit
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: <toa...@ya...> - 2009-04-28 22:10:11
|
In Order to use WinXP visual styles for your controls, you should do the following: Create a XML manifest file called <programfilemane>.manifest (for example: installer.exe.manifest) and place it in the same folder of your program executable file: <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="CompanyName.ProductName.YourApp" type="win32" /> <description>Your application description here.</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly> Then link comctl32.dll library into your program (in MinGW, for example, add -lcomctl32 to the linker command line), and include commctrl.h header file. In the program source, call InitControlsEx function as follows: INITCOMMONCONTROLSEX iccs; iccs.dwSize=sizeof(INITCOMMONCONTROLSEX); iccs.dwICC=ICC_STANDARD_CLASSES; /*See MSDN Library links below for further options */ InitControlsEx(&iccs); More details at MSDN Library: http://msdn.microsoft.com/en-us/library/ms997646.aspx http://msdn.microsoft.com/en-us/library/bb775697(VS.85).aspx http://msdn.microsoft.com/en-us/library/bb775507(VS.85).aspx ________________________________ De: Frederico Marques <the...@ho...> Para: dev...@li... Enviadas: Terça-feira, 28 de Abril de 2009 7:26:15 Assunto: [Dev-C++] [C/C++][Windows XP][GUI] CreateWindowEx()/CreateWindow() does not create buttons with "XP look-and-feel". Hello people. I am currently developing a application that should simulate NeoSoft, InstallShield, and similar installers. I am aware that such packages are available from the Web, however I desire to gain knowledge about such applications. At the moment, I have a problem when I try to create buttons. The buttons created are Win98 like, gray, with no 3d-effect. I tried chaging the button stryles, in the dwStyle argument, and also messing around with dwExStyle, with no success. Below follows a snippet with relevant code only ( for readability purposes. ) /** C code. { */ /** Please assume hwnd as a created window. The following code is triggered it WM_CREATE. */ HANDLE hButtonOk = NULL ; if ( ( hButtonOk = CreateWindowEx( WS_EX_LEFT | WS_EX_TOPMOST, "BUTTON", "Seguinte", WS_CHILD | WS_VISIBLE | BS_TEXT | BS_PUSHBUTTON, // Styles. 250, 330, 100, 25, hwnd, (HMENU)0, hThis, NULL )) == NULL ) { MessageBoxA( hwnd, "Erro Irrecuperável", "Ocorreu um erro irrecuperável a criar um elemento de Gui : hButtonOK", MB_ICONERROR|MB_OK); SendMessageA( hwnd, WM_QUIT, 0, 0 ); return -1; } /** }*/ Please let me know if something is unclear, and of course, if you know the sollution :) Thanks every1 ;D Frederico Marques ________________________________ Quer deixar seu Messenger turbinado de emoticons? Clique aqui e baixe agora. É grátis! Veja quais são os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com |