|
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
|
|
|
|
|
What is the square function in VC++? I have tried using :
pow(a, 2);
but its ridiculously slow (i need to perform many such calculations), now i`ve just got (a*a) instead (which is crap loads quicker). I just need to know that I`ve gone about it the right way.
Cheers all,
Alan.
AEGC
|
|
|
|
|
The fastest way to calculate the square of a number would be to use the * operator as you have already tried out. When you do a*a that's about the best you can do. Because it translates into the MUL instructions directly.
But if you want to do floating point squaring then I am not sure. Perhaps you could try using logarithms [which involve addtitions and not multiplications] which might speed up things.
In the DOS days I remember how we used to set the compiler/linker options to generate 80x87 code that speeded up the mathematics. I wonder whether there is some such thing for win32 stuff too.
Regards
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
Many thanks Nish. I needed to know that that was the best (quickest) way of going about squaring a variable (integers).
Thanks again,
Alan.
AEGC
|
|
|
|
|
when i open a cformview window with small fonts it is ok.
doing the same with large fonts couses the buttons and text to be outside the window.
please help me.
thanks.
Aviv.
avivhal
|
|
|
|