|
hi,
i am trying to transparent the dialog with color using this code. I included the windows.h and winuser.h
<pre>
SetLayeredWindowAttributes(GetSafeHwnd(),RGB(10,34,56),10,(LWA_COLORKEY|LWA_ALPHA));
</pre>
But it gives following error.
\\ITD254\VCC\Notes\NotesDlg.cpp(168) : error C2065: 'SetLayeredWindowAttributes' : undeclared identifier
\\ITD254\VCC\Notes\NotesDlg.cpp(168) : error C2065: 'LWA_COLORKEY' : undeclared identifier
\\ITD254\VCC\Notes\NotesDlg.cpp(168) : error C2065: 'LWA_ALPHA' : undeclared identifier
what i have to do
Ganesh
|
|
|
|
|
Which version of visual studio are you using? Have you set win version (_WIN32_WINNT ) to 0x0501 ?
|
|
|
|
|
vc 6.0 and i tried #define WINVER 0x0500
Os- winxp
|
|
|
|
|
i opened the winuser.h and found that SetLayeredWindowAttributes() is not available.
for that i downloaded winuser.h, which has SetLayeredWindowAttributes() and replaced original but now compiler tells so many errors in winuser.h
any solution
|
|
|
|
|
ganesh.dp wrote: i opened the winuser.h and found that SetLayeredWindowAttributes() is not available.
The SetLayeredWindowAttributes () will not be existing in the header files that comes with visual studio 6. So either you can download the platform SDK from here[^] and integrate it with VC6
or
Call the SetLayeredWindowAttributes () dynamically, using the LoadLibrary () and GetProcAddress () functions. The SetLayeredWindowAttributes exists in user32.dll dll and the value of LWA_COLORKEY and LWA_ALPHA are...
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
|
|
|
|
|
i got user32.dll
but i have some doubt.
1. can i load that dll from my project folder(because i download that from web, my don't doesn't)
2. if load that file in dynamic mode, but before that compiler gives error(for setlayeredwondowattributes()).
Frankly saying i'm new to VC so please guide me
|
|
|
|
|
ganesh.dp wrote: 1. can i load that dll from my project folder(because i download that from web, my don't doesn't)
No you dont have to download it from net. That dll comes with the installation of OS. it exists in the "c:\WINDOWS\system32\user32.dll"
ganesh.dp wrote: 2. if load that file in dynamic mode, but before that compiler gives error(for setlayeredwondowattributes()).
ok. This is how to call that function dynamically.
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
typedef BOOL (WINAPI *pSetLayeredWindowAttributes)( HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags );
HMODULE hUser32 = LoadLibrary( _T("User32.dll"));
pSetLayeredWindowAttributes fnSetLayeredWindowAttributes = (pSetLayeredWindowAttributes)GetProcAddress( hUser32, "SetLayeredWindowAttributes");
if( 0 == fnSetLayeredWindowAttributes )
{
AfxMessageBox( _T("Failed to load SetLayeredWindowAttributes function"));
}
else
{
fnSetLayeredWindowAttributes( m_hWnd, 0, 100, LWA_ALPHA );
}
FreeLibrary( hUser32 );
|
|
|
|
|
thanx...
bit more problem now, there is no compilation error but no transparent or color change is happened..
|
|
|
|
|
ganesh.dp wrote: bit more problem now, there is no compilation error but no transparent or color change is happened..
Have you set WS_EX_LAYERED style? This style is necessary for the SetLayeredWindowAttributes() function to work.
|
|
|
|
|
i got it...
thanx a lot...
|
|
|
|
|
Can any one help me where i can get c++ source code for Casino War game. It should be with the below logic
1)Game Engine
2)Client
3)Server Object
IF it wont be avilable over net..can any one help me to understand how to do a casino war game with C++, which should have a)game engine b) client and c)server object.
if nothing is avilable ..pl let me know where i can get these information.
Thanks,
Nandu
|
|
|
|
|
When I Compile my project I got this Warning
"warning C4819: The file contains a character that cannot be represented in the current code page (874). Save the file in Unicode format to prevent data loss"
I want to solve this problem, Please advise
How can I save the file in Unicode format
|
|
|
|
|
Does this page[^] help? It's talking about how to save files with different encodings in VS2005, using the File Save dialog.
|
|
|
|
|
VS editor now supports Unicode characters as well (for strings to be used in the code). If you don't know what Unicode is, I suggest you to please read up on that.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi all,
I have a list control in which there can be very large number of items and there can be very few items also.....
Property of my list is that it is almost sorted.....
So, i wanted to know that which sorting alogorithm will best suit this situation.....
Thanks in advance
|
|
|
|
|
hi,
u Want to sort list on what basis? Is it a image list??
Samir
|
|
|
|
|
no it just contain integers...
|
|
|
|
|
VCProgrammer wrote: So, i wanted to know that which sorting alogorithm will best suit this situation
The one you don't have to write yourself - the sort algorithm[^] in the C++ standard library is pretty much good enough for most cases.
BTW - can you quantify your "very large number of items"? My very old and slow iBook will sort a million (random) integers in 200 milliseconds using std::sort - that's reasonably quick...
|
|
|
|
|
Hi!
I want to custom-draw menubar in MFC dialog based application.I need the sample code.
Pls help me..............
Thanks & Regards,
Anitha
<div class="ForumMod">modified on Saturday, January 24, 2009 12:51 AM</div>
|
|
|
|
|
Check if this link help u
http://edndoc.esri.com/arcobjects/9.0/Samples/Application_Framework/Custom_MultiItem_and_Menu/CustomMultiItemAndMenu.htm
|
|
|
|
|
|
I need in Dialog based application not in SDI.
|
|
|
|
|
Why not rejig your dialog based app into a non-document SDI app which uses a form view? That gives you the control layout capabilities of a dialog, together with the menu, toolbar and command routing capabilities of SDI.
This page[^] gives good advice, including tips for converting a dialog based app to SDI.
|
|
|
|
|
Hi,
I have created modeless dialogs in MFC using CreateDialog() and dialog is successfully shown.
void ParentDialog::OnButton1()
{
HWND retcode = CreateDialogParam(NULL,
MAKEINTRESOURCE(IDD_DIALOG2),
NULL,
MainWndProc);
}
In message handler, added the following
int APIENTRY MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
return TRUE;
break;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
DestroyWindow(hwnd);
return TRUE;
}
break;
}
return FALSE;
}
After dialogs are displayed, when I am pressing hot keys or escape from the child dialogs, it is not working.
Please help me.
Thanks in advance.
Vinoth
|
|
|
|
|
Hi. ive created a simple BHO(browser helper object) with ATL.
im handling the ondocumentcomplete event and i want to capture the mouse position in the document , i know that there is a really good javascript functions that do that, but the question is can i use in some way javascript code in my ATL project?
|
|
|
|