|
Papa wrote:
while (TRUE)
Papa.WillLove ( Bebe ) ;
Not many events in your loop!;P
|
|
|
|
|
WillLove is a sum of events
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Yes you should put your loop in a thread but if youu want something quick and dirty, call the following function (DoEvents) in your loop.
<br />
BOOL DoEvents()<br />
{<br />
MSG msg;<br />
while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))<br />
{<br />
if (msg.message == WM_QUIT)<br />
{<br />
return FALSE;<br />
}<br />
if (!AfxGetApp()->PreTranslateMessage(&msg))<br />
{<br />
::TranslateMessage(&msg);<br />
::DispatchMessage(&msg);<br />
}<br />
}<br />
return TRUE;<br />
}<br />
|
|
|
|
|
Hi,
1. is manipulating font size, the only way to resize non-owner-drawn conbo box?
2. using SetFont() and resizing combo box, i get the combo box show right but calling GetWindowRect() with list box not dropped, returns some default size, no matter what the actual visible size is. how can i get the correcty visible size?
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Email: y_becker@netvision.net.il
|
|
|
|
|
GetWindowRect should return the size of the combobox + the size of the drop window. When you use MoveWindow(0 on a combo box, the rect you provide includes the drop window size. When the drop window is not whown, I beleive that the combo box sizes to the size of GetSystemMetrics(SM_CYVSCROLL), but if your using a different font, it may not be correct.
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
Thank you Roger,
the returned combo height is indeed constant (SM_CYVSCROLL = 20 on my system) and equals 24.
BUT
how can i get the visible size of the non-list-dropped combo ? is this a system constant as well !?
Roger Allen wrote:
GetWindowRect should return the size of the combobox + the size of the drop window. When you use MoveWindow(0 on a combo box, the rect you provide includes the drop window size. When the drop window is not whown, I beleive that the combo box sizes to the size of GetSystemMetrics(SM_CYVSCROLL), but if your using a different font, it may not be correct.
Roger Allen
Sonork 100.10016
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Email: y_becker@netvision.net.il
|
|
|
|
|
Yonatan wrote:
how can i get the visible size of the non-list-dropped combo ? is this a system constant as well !?
Its something that I have looked for myself. I do not know of a specific constant for it. I have usually simulated it in the past by having another control the same height as a combobox on the form and measuring that.
The other thng you could do is add in some borders:
GetSystemMetrics(SM_CYBORDER) * 2 + GetSystemMetrics(SM_CYVSCROLL);
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
Dear Roger, Dave, thank you again for your answers.
since English is not my mother tongue (hint: i fluently read the original scripture of Ecclesiastes, the resource of the poem Roger quotes ), the question i posed may have been somewhat unclear.
i want to embed a combobox inside a list control subitem. now, by changing the combo font size i can control the combo (==edit+arrow == -1 item) size (SetItemHeight(-1, x) fails here), and visibly make it smaller than system default (without resorting to Owner-Drawn combo). alas, i wish to programatically quantify the combo frame VISIBLE size, to some actual pixel measure (i do not wish to use the resource editor). i cannot get it with GetClient\WindowRect() because of unknown reasons (which have nothing to do with drop down list size).
i hope i could profit from your experience.
Thank you all , yonatan
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Email: y_becker@netvision.net.il
|
|
|
|
|
Use CComboBox::GetItemHeight() /CComboBox::SetItemHeight() with nIndex set to -1 to get/set the height of the edit/static control portion of the combobox
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Dear PJ, thank you for your answer.
Please check my last answer to Roger.
please advise, , yonatan
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Email: y_becker@netvision.net.il
|
|
|
|
|
I have a problem with a FormView. How do you implement copy and paste.
How to activeate cut and paste in the controls on the form.
Please help
Jørgen Granborg
|
|
|
|
|
Add your own handlers for cut/copy/paste
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
void CXView::OnEditCopy()
{
CWnd* pWnd = GetFocus();
if ( pWnd != NULL )
pWnd -> SendMessage(WM_COPY);
}
|
|
|
|
|
Hello,
I am studying an doing applications with C#. I don´t know how transform an EJB to C#. Which are the equivalent files in C# to the files in Java where you define Local and Home Interface? Only with the .cs file and including using in the file where you want to use this classes you are programming with .Net Architecture or is necessary define interfaces in any place in Visual Studio.Net.
Thanks for your help
LUIS
|
|
|
|
|
How to add an item to desktop's context menu or is there an article to read about this?
|
|
|
|
|
For CodeProject articles dealing with programming the Shell and with the Shell API, see to General -> Shell Programming.
The desktop is a part of the Shell. Just like the Start Menu, Quick launch, Task Bar and Tray Area are parts of the Shell.
Here's a direct link to the Shell area: http://www.codeproject.com/shell/[^]
I recommend the article by Michael Dunn 'The Complete Idiot's Guide to Writing Shell Extensions', parts 1 to 8. Happy reading
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I have dialog based application.
Main dialog contains it's own controls, like button, and one TabCtrl.
Tab control contains couple of child dialog windows, their visibility is determined by selected tab in tab control.
I need to make this resizable, but it's flickering to much, especially tab control and child winwow's controls.
I tried to disable OnEraseBkgnd on both main window and child windows, but with no effect.
How to do this ?
Thanks
rrrado
|
|
|
|
|
i am not sure it will work but,
in the resource of the dilaog choose properties of the dialog, and in the style tab check the 'clip siblings' and 'clip children'
this should do the trick.....
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I tried this before, but this didn't work
But thanks for advice.
rrrado
|
|
|
|
|
I am trying to change an environment variable from a code.
I have tried the each one of the following:
1. sprintf(szCatiaBase, "CATIA_BASE=%s" , (LPCTSTR)strCatiaBase);
nRet = _putenv(szCatiaBase);
2. sprintf(szSysCall, "set CATIA_BASE=%s", (LPCTSTR)strCatiaBase);
nRet = system(szSysCall);
3. CRegKey rkRegistry;
CString strValueName("CATIA_BASE");
rkRegistry.Open(HKEY_CURRENT_USER, "Environment");
sprintf(szValue, "%s", (LPCTSTR)strCatiaBase);
LONG lRet = rkRegistry.SetValue(HKEY_CURRENT_USER, "Environment", szValue, (LPCTSTR)strValueName);
rkRegistry.Close();
BUT....
None of the above actually changed the environment variable - when I opened the cmd console and tried to see the envonment variable's value thruogh:
> set CATIA_BASE
I got the old value - meaning - the environment has not changed!!!!
Does anybody know how this should be done so the the environment will realy change?????
Thnx
|
|
|
|
|
Did u try SetEnvironmentVariable?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
On my hard disk I have 4 partitions. The one partition I formatted in the ext2 format so I could run Linux from it. However I would like to now change the format of the partition back to vfat (so it can be seen by Windows). Does anybody know how I can do this? OR is there aprogram available to do this? I don't want to reformat my whole harddisk.
I am the handsome one in the crowd.
|
|
|
|
|
What flavour of window are you running?
To keep linux files - use partition magic. If you don't care for those, delete and re-add partition.
Brian
|
|
|
|
|
I am running Windows 98 .
I don't have partition magic. The problem is that I can't even access the partition with DOS.
I am the handsome one in the crowd.
|
|
|
|
|
I need a program (create it in VC++ console app) that does Disable. or Enable Network Connections like when you do this:
1. Win XP Prof. - Open Network Connections.
2. Right-click the LAN or High Speed Internet connection that you want to disable.
3. Click Disable. or Enable
I was searching in "Platform SDK: IP Helper" IpReleaseAddress
GetAdaptersInfo ...
I did find only a funtion doing the same thing like (win32 command)
ipconfig /release myLocalAreaConnection
BUT this does not help me because we do not have DHCP enabled.
Many thanks for any hints
Marcel Grunder
|
|
|
|
|
I inadvertedly deleted the .scf entery in my Register, so now I can't click on the "Show Desktop" Button. Does anybody know the entry for this in the register? I think it might be something like "%1"%* but I can't get it to accept it.
I am the handsome one in the crowd.
|
|
|
|