|
Actually, all you need to do is in the non client click handler....i tested it with a dialog but any cwnd should do:
void CDummyDlg::OnNcLButtonDown( UINT nHitTest, CPoint point )
{
// swallow caption hits, let all others go through.....
//
if ( nHitTest != HTCAPTION )
CDialog::OnNcLButtonDown( nHitTest, point );
}
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Direct, Easy and now working for me!
thanks!
|
|
|
|
|
You can also override WM_MOVING and WM_SIZING to force (or disallow) selective motion (hugging an edge, resizing to specific sizes only, etc).
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
infect i want to halt ctrl+alt+del after writing my gina dll?
but i could not sucessed yet.
can any body provide the link of related examples?
i have searched a lot but i could not sucessed to find it out .
i need some gina examples.
r00d0034@yahoo.com
|
|
|
|
|
Bonjour,
All you need I think ...
http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx
Simplicity is the supreme sophistication.
-------------------------------------------
http://www.borie.org/
|
|
|
|
|
|
i have used this function, it return sucessfully but the system is not login and desktop did not appear.
is there any step remains ?
or is there any mistake?
if yes plz tell.
i will be very thank full to you.
BOOL Successful;
HANDLE AccessToken;
DWORD ErrorCode;
char *BufferPtr;
::SetCursorPos(20,20);
Successful = LogonUser ("super", ".", "super", LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &AccessToken);
r00d0034@yahoo.com
|
|
|
|
|
there are plenty of examples in MSDN that shows you how to implement that stuff...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I posted a threaad earlier on, but I still have probs
I need to enter a username, password and domain. Then it needs
to validate this info from a server (permissions, privileges,
groups etc..).
The code below works fine to logon to windows, but I need to check whether a user is part of a particular group? CAn anyone shed any light into the matter.
int AttemptLogon()
{
HANDLE hUser;
TOKEN_STATISTICS TStats;
TOKEN_GROUPS * pGroups;
PSID pLogonSid;
PLUID pLogonId;
HANDLE hUserToken;
DWORD size;
MiniAccount stAccount;
pLogonId = new LUID;
pLogonSid = new SID;
strcpy(stAccount.szUsername, "eric");
strcpy(stAccount.szDomain, "cognitronics");
strcpy(stAccount.szPassword, "");
if (LogonUser( (LPTSTR)stAccount.szUsername,
(LPTSTR)stAccount.szDomain,
(LPTSTR)stAccount.szPassword,
LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT,
&hUser))
{
hUserToken = hUser;
//
// Now, grovel the token we got back for interesting
stuff:
//
GetTokenInformation(hUser,
TokenStatistics,
&TStats,
sizeof(TStats),
&size);
*pLogonId = TStats.AuthenticationId;
pGroups = (TOKEN_GROUPS*)LocalAlloc(LMEM_FIXED, 1024);
if (!pGroups)
{
CloseHandle(hUser);
return(WLX_SAS_ACTION_NONE);
}
//
// The tricky part. We need to get the Logon SID from
the token,
// since that is what Winlogon will use to protect the
windowstation
// and desktop.
//
GetTokenInformation(hUser,
TokenGroups,
pGroups,
1024,
&size);
if (size > 1024)
{
pGroups = (TOKEN_GROUPS*)LocalReAlloc(pGroups,
LMEM_FIXED, size);
GetTokenInformation(hUser,
TokenGroups,
pGroups,
size,
&size);
}
int n = pGroups->GroupCount;
for (int i = 0; i < pGroups->GroupCount ; i++)
{
if ((pGroups->Groups[i].Attributes &
SE_GROUP_LOGON_ID) == SE_GROUP_LOGON_ID)
{
CopySid(GetLengthSid(pLogonSid),
pLogonSid,
pGroups->Groups[i].Sid );
break;
}
}
LocalFree(pGroups);
return(WLX_SAS_ACTION_LOGON);
}
delete pLogonId;
delete pLogonSid;
int nLastError = GetLastError();
return(WLX_SAS_ACTION_NONE);
}
Does anyone have any ideas or sample source code.
Thankyou for your time
Rich
|
|
|
|
|
sorry for Inconveniences.
but plz solve my problem.
you say?
The code below works fine to logon to windows, but I need to check whether a user is part of a particular group? CAn anyone shed any light into the matter.
but the important thing for me is that you say
"The code below works fine to logon to windows"
did desktop appears after using this code please ans the above thread thats my question?
i will be very thank full to you.
r00d0034@yahoo.com
|
|
|
|
|
Richard Hudson wrote:
The code below works fine to logon to windows, but I need to check whether a user is part of a particular group? CAn anyone shed any light into the matter.
You can use some of the net* functions to check to see if a user is in a group.
I'm sorry, but I don't remember the exact function right now...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
when we are at logoff state in professional xp a window is displayed having a window text
-------------------
LOG ON TO WINDOW
-------------------
that window has two edit box one for username and other for password i want to get the hwnd of these edit box and want to type username and password and click a button
and the code i have used for this purpose is this
POINT pt;
::GetCursorPos(&pt);
HWND h=::WindowFromPoint(pt);
-----------------------------------------
for typing some characters i use this code
-----------------------------------------
::SendMessage(h, WM_CHAR, (WPARAM) 's', (LPARAM) 0);
::Sleep(300);
::SendMessage(h, WM_CHAR, (WPARAM) 'u', (LPARAM) 0);
::Sleep(300);
::SendMessage(h, WM_CHAR, (WPARAM) 'p', (LPARAM) 0);
::Sleep(300);
::SendMessage(h, WM_CHAR, (WPARAM) 'e', (LPARAM) 0);
::Sleep(300);
::SendMessage(h, WM_CHAR, (WPARAM) 'r', (LPARAM) 0);
-----------------------------------------------
for clicking purpose i use this code
::SendMessage(h,WM_LBUTTONDOWN,0,0);
::SendMessage(h,WM_LBUTTONDOWN,0,0);
::Sleep(300);
::SendMessage(h,WM_LBUTTONUP,0,0);
i get mouse position when mouse is at one of the edit box and button of that window.
that code executed at any other window sucessfully but it does not execute at this(described above)window.
what to do ?
is there any change in logic ?
r00d0034@yahoo.com
|
|
|
|
|
What you need is the mouse_event or the SendInput functions.
[edit]Oops, sorry:
I think that for security reasons you can't control nor send events to the Logon window. I don't recall a reference right now...
[/edit]
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
If you want to get access to the logon screen you must perform this inside a GINA.DLL. programatically it's impossible to get access to the logon screen if you don't do it from that DLL.
You can create a gina dll and make this... take a look at the msdn for more info.
(I've never done it, but I have readen something because some time ago I was interested in something similar...)
Hope this helps...
|
|
|
|
|
My project has been "hanging" lately on rebuilds using VS6... Like right now, it's:
Generating Code...
Creating library...
And no CPU is being used in task manager?!?! If I Cancel build, it locks up and I can't terminate the process via the task manager because it thinks the program is being "debugged" So the only thing I can do is kill the power
I am using VS6 SP3. I can't use SP5 (or 6?) because some of our libraries expose many bugs in those SP's. Anyone have a clue?
P.S. I'm compiling across the network. I'm going to try to copy the project to my local machine next. But our network is fine, and plenty fast...
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
It's not a COM project that you are compiling is it?
Michael
Life’s not a song.
Life isn’t bliss.
Life is just this.
It’s living. -- Buffy the Vampire Slayer: Once more, with feeling
|
|
|
|
|
No. I'm using this zip library[^] and some 3rd-party ActiveX controls[^]. Strangly enough, it seems I have winamp playing and outlook open when it will do it.... I copied the project to my local machine and deleted all the .obj stuff and the .ncb file, rebooted the machine, and the rebuild worked. I feel it's just a matter of time before it does it again...
What's the deal with COM prj? Can it be related? Does ActiveX use COM at all (i wouldn't think so)? Also, why would it be so wishy-washy? You would think if something's wrong, it would hang all the time... I'm keeping track of the clues. Does anything sound fishy to u?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
I had a similar problem when the compiler tried to register the COM project. I had some dodgy code in the COM objects start-up code which prevented the COM object being registered by the compiler. Took me an age to fix it.
Although by the sound of it, it's more likely to be something else.
Michael
Life’s not a song.
Life isn’t bliss.
Life is just this.
It’s living. -- Buffy the Vampire Slayer: Once more, with feeling
|
|
|
|
|
Using VC6, SP? (probably 3, I'm not sure).
If we compile too much modules of our application with debug (/Od /Zi), then we get a floating-point invalid operation in a specific routine of our application. Recompiling that routine without debug (or with debug) does not seem to help.
Only if we recompile everything without debug again (/Ox /Oy-) the application runs correctly again.
If it crashes it always crashes in the same location, and it would even crash on the following source then:
double d1;<br />
double d2;<br />
d1 = 0.0;<br />
d2 = d1 + 1.0;
I've now upgraded to SP5 (hope the problem doesn't occur anymore), but I would like to know if this is a know problem or if anyone of you have encountered this problem too.
Btw, how can you see which Service Pack of Visual C++ is installed? Our system manager couldn't find it out either.
Thanks.
font color=#ff0000>Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
[also posted in the COM forum - not sure which forum is more appropriate]
Hi all,
Can anyone point me in the right direction of information about using the Excel grid in a VC++/MFC app? I'm just looking to get the grid on a view / dialog, maybe manipulate some rows / columns (via code), etc.
Is this even doable?
Dylan
"In meetings, the person who is least competent usually does the most talking. Talking is a direct substitute for competence, at least in the minds of other people. Five minutes after you leave a meeting, you won't remember what anyone said but you will remember who did most of the talking. Withing a day your mind will translate that into a notion that the talker was unusually knowledgeable" - Scott Adams, Dilbert and the way of the weasel
|
|
|
|
|
Why not use this[^]?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
I've been given the task of "evaluating the feasability of using Excel's grid" to work with our app. It's part of a larger grid evaluation thingy I've been tasked with, so I really need to get to grips with using Excel from VC for this one. I did find this[^], which is a nice starting point
Dylan
"In meetings, the person who is least competent usually does the most talking. Talking is a direct substitute for competence, at least in the minds of other people. Five minutes after you leave a meeting, you won't remember what anyone said but you will remember who did most of the talking. Withing a day your mind will translate that into a notion that the talker was unusually knowledgeable" - Scott Adams, Dilbert and the way of the weasel
|
|
|
|
|
Well, good luck. I take it "they" realize Excel needs to be installed on each machine your app will run on... BTW, I once was considering the same thing and after perusing the same MSDN article, I thought: "If all I'm doing is providing excel functionality, why not just use excel (and heaven forbid: VBA )?" But hey, it's all about the right tool for the job.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Try this: http://www.codeproject.com/com/xoffice.asp
Beware though, there are problems if the user has Norton Antivirus installed - see the comments.
--
The Obliterator
|
|
|
|
|
Hi,
I have a dialog implemented using the CPropertySheet. To this I add as two pages two diff dialogs. I want the whole thing to be colored diff(grey is boring)
To change the color of dialogs, I can override the WM_CTLCOLOR.
I tried the same with propertysheets, but it fails to change the color.
Any suggestions are most welcome.
Regards,
Deepti.
|
|
|
|
|