|
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
|
|
|
|
|
1) I'm writing a program that uses odbc and microsoft access database as source. Is there a way that I can programatically set the information about the database in the ODBC Administrator in the Control Panel? If yes please give me an example.
2) I need to print a specific area of the form(It's a SDI App) and I'm not sure what to do. CRgn or what. How can I specify that region and print it? Also I must show that region in the print preview, but since OnPrint is only function called both for Print and print preview I guess I will need just one code for both things.
thanks,
Deian
|
|
|
|
|
Hello all!
I’m trying to use the new Windows XP Visual Styles API (the themes stuff) to draw a toolbar, but I’m stuck I’m trying to get the font to draw the buttons but I have no idea of what is a PropId or where to get it from..... and the help of online help helps nothing...... So my question is, what is a PropId and where are they defined?
My code snipped,
HWND m_hWnd;
HDC hDc;
...
HTHEME hThemeToolBar= ::OpenThemeData(m_hWnd, L"TOOLBAR");
LOGFONT log;
// the propid (?) that I’ve copied from the TmSchema.h file
int iPropId= TMT_CAPTIONFONT; // What value to place here? I’ve also tried to make a for with all possible values but only one (PropId 12) returned a valid hr result and that one with a strange LONGFONT result…..
HRESULT hr= ::GetThemeFont(hThemeToolBar, hDc, TP_BUTTON, TS_NORMAL, iPropId, &log);
...
The error returned has always 0x80070490 (Element not found.)... the PropId 12 is the only one that returned a hr of 0, but I have no idea of what is it.... since the font returned is very strange.... and also with the call to GetThemeFont the Theme handle (hThemeToolBar) becomes invalid!?
Anyone can help me with this?
Thanks in advance!
Rui Lopes
|
|
|
|
|
Hi
I am working on a ActiveX project where I want to implement XP Theme onto my controls. While searching www.codeproject.com I came across your posting, and ofcourse without an answer. (infact I could find only yours)
Could you please spare some time of yours? I am also in the same posistion as you, and couldnt find answers regarding this. Did you manage to use GetThemeFont on BUTTON and TOOLBAR ? If so I will be grateful if you could share this with me.
Thanking you and awaiting your response,
Mohamed Shiraz T K
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hello,
Sorry, but I didn't managed to make it work. I was just trying it out for the fun, so I scrapped the whole thing.
Though, if you can make it work, I would like to known
----
Rui Lopes
|
|
|
|