|
the ID or the window
Vikas_123 wrote: Whihc parameter should I pack in WPARAM so I can uniquely identify the ListCtrlEx which send the message.
You may use either the ListView control ID or its window handle.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am getting a linking error while using the following code from MSDN.
BOOL IsUserAdmin(VOID)
/*++
Routine Description: This routine returns TRUE if the caller's
process is a member of the Administrators local group. Caller is NOT
expected to be impersonating anyone and is expected to be able to
open its own process and process token.
Arguments: None.
Return Value:
TRUE - Caller has Administrators local group.
FALSE - Caller does not have Administrators local group. --
*/
{
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&AdministratorsGroup);
if(b)
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
{
b = FALSE;
}
FreeSid(AdministratorsGroup);
}
return(b);
}
|
|
|
|
|
|
I have linked Advapi32.lib.. But still getting this error.
|
|
|
|
|
Check whether you've included that library in your both (or all of) configuration (i.e. Release, Debug). I suspect that.
- Malli...!
|
|
|
|
|
No.. It is included. I am using vc++6.0. I doubt whether this works in VC++6.0.. I am not sure.
|
|
|
|
|
Can you please paste the linking error here ?
- Malli...!
|
|
|
|
|
Since CheckTokenMembership() is on Windows 2000+, you may not have
a library in your old SDK that has the export (if you're using an old SDK).
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I have a Parent Dialog on which there is a child dialog with three Group Boxes . Is there any way that i can change the background of the three group boxes. The group boxes are having certain static labels which have value during run time as well as statically.
So please tell me the way to change the background of the group box which is a part of child dialog.
I am working on mfc.
Thanks In Advance.
Dhiraj Kumar Saini
|
|
|
|
|
|
|
I am trying to use the tab control in VS2003, I have added the tab to a dialog template in the dialog editor and used the TCM_INSERTIEM message to add my tabs to the tab control. My question is how do I add a child window to a specified tab? (not using MFC BTW).
|
|
|
|
|
There's lots of info and some sample code here:
Tab Controls[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi.
We are doing TCPIP communications between an old system (DOS) and a WinXP system. We put all the message contents into a struture. Because the DOS side we can not change, we encountered a few problems that seems to be related to byte alignment.
I think on the windows side, it needs to be 4 byte aligned. But on the DOS side it seems to be 2 byte aligned. As a result, it seems when you access a specific variable using pointers or use "sizeof" it gives the wrong result.
Is there anyway to force the alignment correctly so that nothing will be "padded"?
Thanks in adavnce.
Stan the man
|
|
|
|
|
Use pragma pack around your structure definition:
#pragma pack(2)
struct MyStruct
{
..
..
};
#pragma pack()
|
|
|
|
|
HI.
Thanks for the reply. IT only needs to be around the definition call. I do not have to do anything else when I call it or use it then, right? Just want to be sure...
Thanks.
|
|
|
|
|
Stan the man wrote: IT only needs to be around the definition call
What do you mean by "definition call" ? Anyway, it only needs to be around the structure definition. When you use the structure afterwards, the byte alignment will be on two bytes (in this case).
|
|
|
|
|
|
In addition to what Cedric wrote, note that packing alignment may only be part of the problem. Type sizes may be different in old DOS-based software, so an struct member of type int may only be 2-bytes wide in DOS as opposed to 4-bytes wide in Win32.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I am using MFC.
In my application i am using two label one for e-mail id and other for certain URL.
Initially I have set its property of Visible to be false.
Now when these two labels have certain values during runtime i want to make them visible.
Please tell me how to make the static labels visible during run time.
Thanks In Advance.
Dhiraj Kumar Saini
|
|
|
|
|
ShowWindow function can be used to make the static control visible during runtime
GetDlgItem(IDC_STATIC)->ShowWindow(TRUE)
u can try using this.
|
|
|
|
|
GetDlgItem(ID_MYCONTROL)->ShowWindow(SW_VISIBLE);
|
|
|
|
|
if(label_has_certain_values_during_runtime)
{
GetDlgItem(IDC_STATIC_EMAIL)->ShowWindow(TRUE);
}
|
|
|
|
|
one thing more to remember they shouldn't have ID liek ID_STATIC! ok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
I have already download the sourcecode of Transparent Flash Control
http://www.codeproject.com/KB/COM/flashcontrol.aspx
now I want to draw something on the flash control, I do it like this
OLECONTAINER(void)::Draw(HDC hdcDraw, const RECT *rcDraw, BOOL bErase)
{
HWND hwnd = GetHWND();
HRESULT hr;
RECT r;
IOleObject *lpO = m_lpO;
IViewObject *lpV = m_lpViewObjectEx ? (IViewObject
*)m_lpViewObjectEx : m_lpViewObject;
// if (!m_bTransparent)
{
RECT rTotal;
::GetClientRect(hwnd, &rTotal);
if (lpV)
{
if (!hdcDraw)
{
hdcDraw = ::GetDC(hwnd);
hr = OleDraw(lpV, DVASPECT_CONTENT, hdcDraw, &rTotal);
::ReleaseDC(hwnd, hdcDraw);
}
else
{
hr = OleDraw(lpV, DVASPECT_CONTENT, hdcDraw, &rTotal);
}
}
TextOut(hdcDraw, 0, 0, "test", 4); // <======= do it like this
return;
}
but nothing happen......how can I do it ?
|
|
|
|