|
Hi there...
I have a dialog based application, which is always on top (HWND_TOPMOST). I have fixed the position of the dialog box to the bottom portion of the screen.
# Now, as soon as the dialog is displayed, I would like to resize the height of all the other already running applications windows, with in the space above my dialog window. Can u tell me how to do this? How do I get the other window handles?
# Also, is there a way to control the positioning of applications that could be spawned in the future? What I want is to reserve one fourth portion of the screen, when my application is running, as I dont want portions of other apps to go beneath my dialog(which is always on top).
Thankx in advance.
-Dave
|
|
|
|
|
I think you'd be better off, making your dialog an app-bar. Similar to the office short cut bar
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
..and how do I do that? Any material in this forum which can put some light on the how-to-do part of it?
Also, if decide to make it a app-bar, will it have all the properties that I desire?
Thankx again Nish..
-Dave.
|
|
|
|
|
Look up this function :- SHAppBarMessage
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I wanna to do that: click a button ,then cursor changed (for example a hand cursor) ,until click somewhere again,the cursor change to normal. I do that in my application'w windows. But the cursor change to normal as soon as it move out the application's window,Why? and what can I do ?
this is my code responsed WM_SETCURSOR
BOOL CTestDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if(!m_bArrow)
{
//IDC_CURSOR1 is my cursor resource
::SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));
return TRUE;
}
else
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}
thank you!
|
|
|
|
|
The dialog window's class cursor must be null too.
Nish
p.s. MSDN Snip follows :-
The cursor is set only if the new cursor is different from the previous cursor; otherwise, the function returns immediately.
The cursor is a shared resource. A window should set the cursor shape only when the cursor is in its client area or when the window is capturing mouse input. In systems without a mouse, the window should restore the previous cursor before the cursor leaves the client area or before it relinquishes control to another window.
If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.
The cursor is not shown on the screen if the internal cursor display count is less than zero. This occurs if the application uses the ShowCursor function to hide the cursor more times than to show the cursor.
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
This is my 2nd reply to your post. I think I might have mis-interpreted your question. If you want to change the windows cursor then you might want to look up :-
SetSystemCursor
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I have MS VC++ 6.0 on Pentium 4 @1500MHz.
Scrolling the screen or typing is incredible slow! Every other program works ok,
cpu shows 0-4% load while moving up ONE line can take 2-3 seconds.
The project I have open is not big and I have used it on laptop without any
problems.
Could slowliness be caused by having the project files on a server?
(The server is fast, usually I have no problems with it)
I need to upgrade to AMD? *grin*
|
|
|
|
|
I have no idea why, but moving the files from the network
drive to my hard disk removed the "lag".
|
|
|
|
|
long h3
double h2;
float h4;
h4=4.35*100*150/100.0; //float
h3=(long)(h4+0.5); //=653 !
h2=4.35*100*150/100.0; //double
h3=(long)(h2+0.5);//=652 !
What is wrong in the source sample ? Bug casting ? Illegal casting ?
Tanks for your answers.
|
|
|
|
|
What version of VC++ are you using? Is this all the relevant code? On VC++ 5.0 your code compiles fine (after adding a missing ';' after long h3 ) and I only get a warning message in the assignment to h4 :
warning C4305: '=' : truncation from 'const double' to 'float'
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Sorry for the missing ";"...
I know the warning... but I'm very surprised it works in VC 5... I use VC6... I'm going to install my old VC 5 to see if I have the right result.
Thanks.
Seb.
|
|
|
|
|
Are we talking about the same thing ? I have no problem to compile this code. What I am searching is why the result is different between the 2 lines (652 != 653)...
|
|
|
|
|
Oh, I completely misunderstood your first point. Sorry.
There's nothing wrong with your code. The strange behavior is due to rounding errors inherent to floating point arithmetic. These numbers are stored in a internal format like this:
s*mantissa*2^exponent
Where s is the sign (+1 or -1) and mantissa is a number between 1 and 2, with a fixed number of decimals. Due to the limited amount of decimals (binary decimals, to be exact) in mantissa, some numbers that in base 10 have a finite number of decimals can only be approximated by a float or a double . Also, these two types reserve differents amounts of memory for representation: float s are 4 bytes wide and double s take 8 bytes, so these latter are more precise although this is not always the case --keep on reading.
In your specific case, I've taken a look at the internal representation of h4 and h2 and the exact values are:
h4 = 10690560 * 2^-14 = 652.5
h2 = 5739450696990719 * 2^-43 ~ 652.49999999999988631316227838...
and from this is obvious to deduce why you obtain different results when adding 0.5 and truncating to long .
If you want to know more about floating point arithmetic, do a search on Internet for "IEEE 754" (the standard most microprocessors are based upon for this kind of things).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have installed a VC 5 : same problem (652 vs 653)
Can you test this :
h4=2.67*100*150/100.0; //float
h3=(long)(h4+0.5); //= 401 ???
h2=2.67*100*150/100.0; //double
h3=(long)(h2+0.5);//= 401 ???
I suspect an error on some type of configuration...
Thank your for your answer...
Seb.
|
|
|
|
|
The double h2=0.5+ (4.35*100*150/100.0); isn't actually 653 but looks like it is
652.9999999999999 , hence the cast truncate returns 652.
printf and the IDE debugger don't show this.
we can see by adding this code
if ((653.0-h2)==0) printf ("equal\n");
also by adding .0000000000001 to h2 before the cast, it then becomes 653 as expected.
The float value must be truncating somewhere and avoiding the rounding error. . (guessing)
|
|
|
|
|
Question: Does this SDK work with MFC?
If so are there any documents? Seems MS make their docs a lil hard to understands hence my lack of success with MSDN
Thanks
Ashman
|
|
|
|
|
The SDK is based around COM interfaces, so yes it will work with MFC/C++/ATL etc?
The only documentation I've seen so far is on the November 2001 platform SDK. I had a quick glance and found it to be a little confusing also. I have an idea for using the SDK but I'm going to have to do some reading first.
Michael
|
|
|
|
|
Hello everybody!
Who may help me with such question
The size pInfo->m_rectDraw always is less than structure CPrintInfo , than the real size of a sheet.
Whether it is possible to determine displacement m_rectDraw from the left top corner of a sheet, if yes, as?
Best regards,
Eugene Pustovoyt
Sonork ID 100.10002:Yaumen
|
|
|
|
|
Can I build a CDialogBAR from an in memory resource, a dlgtemplate?
I prefer memorybased Dialogs then .rc-based one for several reasons and I wanna do so with DialogBars, too. Is it possible?
What do you think about dlgtemplATE-Dialogs at all, any pros or contras?
mfg HintiFlo
|
|
|
|
|
If you leave the .rc .bmp empty you could always add whatever you want from the code. You would still be stuck with the resource though, but that is the way CDialogBar works.
You can also use a CToolBar to add arbitrary controls in. But this also requires a resource. CToolBar provides more control with GetToolBarCtrl(), so if you want to do more advanced stuff, that is probably the way to go.
Cheers,
/Fredrik
Sonork ID: 100.11430:PhatBoy
|
|
|
|
|
Hi,
I´m running word as embedded ( like if it where and standalone application) throught automation, I would like to move and resize the window to a desired position and size ( just to make it fit between my windows), but I got the problem that it seem that Word doesn´t work with pixels ???, do you now something about that ?, How can I convert from pixels to word coordinates in order to move the Ms Word window ?
I use the methods from the application interface:
SetLeft();
Resize();
Thanks, Bye !
Braulio
|
|
|
|
|
I would like to create a vc++ application which could be used from excel. in fact i would like to use the calculation possibilities from c++ and use the environment of excel. I heard that i have to create a dll application, but i never do that before, so i would like to know if anybody could give me a sample of code or indicate me a place where i could find some explanation to do that.
thanks in advance
gerald
|
|
|
|
|
there's an MSDN sample called COMEXCEL, which controls an Excel-programm out of a c++-app. Maybe youcan make it go in the other direction!
good luck!
|
|
|
|
|
i don't want to control excel, i just want to do some calculation with c++ from excel so that i could use the excel environment and benefit of the vc++ compilation
do you see what i mean?
|
|
|
|