|
sweet thanks for help.
got it to work.;)
|
|
|
|
|
Hey guys
Is there away to detect the standard windows\system directory for an OS. becuase windows and winNT based systems have different paths ie winnt is \winnt\system32 and windows is windows\system32 or it could be completly diffrent if the user choose to install windows to a different directory.
|
|
|
|
|
::GetSystemDirectory
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hey Guys
Another question
How do i get the handle to module in an executable i tried _Module.GetInstance() but it just through up errors. Saying that it was an undeclared identifier.
I need the handle so i can use loadstring.
Cheers
Peter
|
|
|
|
|
GetModuleHandle(NULL) will return the handle of the calling process
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
That Doesn't want to work either
i keep getting the error _Module is an undeclared identifier.
|
|
|
|
|
|
Hey Guys
What the quickest way to detect which windows version it is in c++.
Peter
|
|
|
|
|
GetVersionEx
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
Use the OSVERSIONINFOEX structure with ::GetVersionEx() .
Jon Sagara
"After all is said and done, usually more is said than done." -- Unknown
|
|
|
|
|
Anyone who knows?
OBS! I'm not interested in the drive letters, only physical drives.
|
|
|
|
|
Use GetLogicalDriveStrings first to get the list of logical drives in a buffer.
Now use GetDriveType on each logical drive
For each DRIVE_FIXED you get as return value increment your hard-disk-count variable.
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
One can have several logical units on one physical disk.
|
|
|
|
|
You are correct. Obviously my method is flawed. Perhaps there is a lower level API to enumerate the physical drives.
Good luck!
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
Using NT, try iterating \\.\PhysicalDrive<n>
where "<n>" is 0..n, and CreateFile(). Note that you will probably need to have Admin right for this to work.
To discover this basically depends on what Win32 OS you use.
/Mike
You can accuse Microsoft for anything but consistency and orthogonality.
|
|
|
|
|
How can I get the font size defined for thwe operating system using a windows API function?
Thanks,
Aviv.
avivhal
|
|
|
|
|
You can use SystemParametersInfo() to retrieve the logical font information for the current icon-title font (SPI_GETICONTITLELOGFONT). The returned LOGFONT struct contains the font size. Sorry, but I don't know how to get the font information for other fonts.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi all,
How can i set focus to one of my controls in the dialog ?
I tried with this:
GotoDlgCtrl(GetDlgItem(IDC_EDIT1));
But it didn't work !
I tried with this code:
GetDlgItem(IDC_EDIT1)->SetFocus();
But it didn't work, too !!!
Why ?!
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Associate your control with a control variable using the class wizard. For example you can associate your edit box with c_edit1.
Now give :- c_edit1.SetFocus()
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
I don't want to create Member variable of my editbox, so i have other way ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Put this under your WM_INITDIALOG handler
GetDlgItem(IDC_EDIT01)->SetFocus();
return false;
This should work. You said it didn't work for you. That's probably because you forgot to put return false . By default it is return true . You have to change that to return false .
Sonork ID 100.9786 voidmain
|
|
|
|
|
Ok, but i want to set focus to EditBox when user hit OK button, not in OnInitDialog() ...
How can i solve it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hmm
Well I just created a dummy dialog based project and added an edit box and a button. I adde this to the button's on-click and no-problems at all. Focus did shift to the edit control.
void CTestDlg::OnButton1()
{
GetDlgItem(IDC_EDIT1)->SetFocus();
}
Sonork ID 100.9786 voidmain
|
|
|
|
|
To add to that...
Since you mentioned the OK button I also tried this and no-problems again
void CTestDlg::OnOK()
{
GetDlgItem(IDC_EDIT1)->SetFocus();
}
Sonork ID 100.9786 voidmain
|
|
|
|
|
I don't know ...
I'll check it again, and tell you result ...
Thanks !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|