|
Do it in OnInitialUpdate().
Kuphryn
|
|
|
|
|
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
lpMMI->ptMaxSize.x = 640;
lpMMI->ptMaxSize.y = 480;
lpMMI->ptMinTrackSize.x = 640;
lpMMI->ptMinTrackSize.y = 480;
CFrameWnd::OnGetMinMaxInfo(lpMMI);
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I want my mouse move only in my window. Please tell me How I could do? And more, how could set the mouse position? Get distants although my mouse reach the limit of screen?
[IMG]http://sinhvienufa.vietnam-it.com/forums/html/avatars/dethuong/Avatar7A1F.gif[/IMG]
|
|
|
|
|
One solution is to keep track of the pointer coordinate. If it is outside the program's boundaries, then reposition it.
Kuphryn
|
|
|
|
|
Just my opinion but...
bad bad bad move. Your application doesn't own the mouse. You shouldn't be restricting mouse movements only to your window. Any application that did that on my system would be immediately removed, forever.
Rob Manderson
http://www.mindprobes.net
You have an eight-ball and Tommy wants to buy two grams. You bought the eight-ball with a quarter-bag of grass, two reds, a six-pack of Old Milwaukie, and $4 in change. You want a profit margin of 35%. How much hash should you get from Tommy for your blow? - Roger Wright
|
|
|
|
|
|
ICE_WIZARD wrote:
I want my mouse move only in my window. Please tell me How I could do?
There is ClipCursor() , but it doesn't give you absolute total control over the cursor. The cursor is a shared resource and the user is in control of it, so if he Alt+Tabs to some other window, your ClipCursor() coordinates are discarded.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
Normally it is a bad idea to limit the mouse pointer to an area of the screen. But if you do need to do it, the API call ClipCursor(Rect) can set a liit area and the call ClipCursor(NULL) restores movement to the whole screen. Be careful with these!
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Well, the title must explain my great problem
I installed some data on a Storage Card (256 MB SD Card) and try to manage to get the size and the free space of this SD Card from a desktop computer ! I already use CeFindFirstFile with the name of the Storage Card, check if it is really a storage card if CE_FIND_DATA.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_TEMPORARY) != 0 , but CeGetStoreInformation just return me the size and free space from the data area of the main memory. Typically, on my 64 MB iPAQ, 40 MB is reserved for the datas, and 20 MB for the programs. CeGetStoreInformation return me 40 MB and 5 MB free (current config)
My SD Card is 256 MB and have 20 MB free ! Is there a function to use through RAPI to know that, giving the storage card's name as parameter ? For instance BOOL CeGetVolumeSpace(DWORD &o_pnSizeVolume, DWORD &o_pnSizeVolumeFree, CString const& i_poStrStorageCardName); !
VERY URGENT AND IMPORTANT, sorry...
Kochise
In Code we trust !
|
|
|
|
|
I need a routine where for every sequential integer i need a unique RGB value that is visually distinct . Does any one know about such a routine ?
|
|
|
|
|
Well, since each component of the color has a range of 0-255, there are 16,777,216 possible colors.
for (int nRed = 0; nRed < 256; nRed++)
{
for (int nGreen = 0; nGreen < 256; nGreen++)
{
for (int nBlue = 0; nBlue < 256; nBlue++)
{
some_unique_color = RGB(nRed, nGreen, nBlue);
}
}
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks for the reply . What I meant was by supplying an integer value to a function I needed visually distinct values of COLOR . I was hinting at the choice of an offset
as for eg
1 =Black
2 =Red
3= Green
4= Blue
5= Orange
6= Light Blue
Something like that . each integral transition should trigger an appropriate shift/addition to RGB values . I needed a clue to do something like that
|
|
|
|
|
Hi,
I am need to have Mutiple Instance of a executable(process.exe) i my application. My application will be listening for request in a port. It will be done by a seperate executable(listener.exe) .Once it get request it has to send the request to one of the process.exe executable by using a load sharing technique. Once the process.exe performs the proces it has to send the response back to the requesting system. All these executable are installed as a service in my system.Can u help me in deigning the system. I am developing all these in VC++.
-Thanks in Advance
Varadha
|
|
|
|
|
It sounds to me like using threads would be MUCH easier.
However, if you really do need multiple executables, look into CreateProcess . You can tweak many different facets of spawning an executable with this function, including whether it shows a window or not, its priority, and you can get a handle to the process launched, and can check to see if it has finished, what its return value was, and so forth.
If your nose runs and your feet smell, then you're built upside down.
|
|
|
|
|
Is this the correct approach to use a prescribed port between two machines, and have Send in one thread and Receive in another thread (since two sockets can't have the same port):
In thread one, create a (TCP connection-oriented) socket and do the Bind (using an IPEndPoint for this local machine on port 8000), Listen, and Accept. Pass the socket returned by the Accept to thread two, and have thread two connect (using an IPEndPoint to the remote port 8000) and Send. After each send, reuse the socket and do another send.
Asynchronously in thread one do Receive's using the socket returned by the Accept. After each buffer is received, queue it (for use by a thread three), and reuse the same socket for another Receive.
The remote sends unsolicited buffers at a fair rate of speed to port 8000, and accepts occassional inbound buffers on its port 8000.
Lee
|
|
|
|
|
Usually, you just want to use the socket you get from Accept for both sending and receiving. You don't have to connect back to the client machine. The client will use the socket it uses to Connect for both sending and receiving as well.
You don't have to worry about "running out" of sockets on port 8000; once you've accepted a connection the port number isn't really used anyway. The only socket that's really bound to 8000 is the Listen socket.
If you are sending and receiving asynchronously, you can use the same socket in a send thread and a receive thread, or you can use the non-blocking functions and run the whole thing from one thread.
|
|
|
|
|
|
hi everybody!
i would like to make two CStatic controls overlap, that is, i would want one CStatic with either the SS_BITMAP or the SS_ICON properties to be placedo over a SS_BITMAP CStatic. i have tried many combinations, but i just can't get it right! can anybody help?
or are there other way's to do it?
thanks,
eugi
www.eugigames.tk
|
|
|
|
|
You will need to ensure the tab order is correct so the "lower" static control draws before the "upper" one. You'll probably also need to give them both the WS_EX_CLIPSIBLINGS style, and maybe the WS_EX_TRANSPARENT style so that they redraw when necessary without stepping on each other.
Shog9
I returned and saw under the sun,
that the race is not to the swift,
nor the battle to the strong...
|
|
|
|
|
thanks! i'll try it and i'll let you know!
www.eugigames.tk
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_0fzo.asp
i read your link...i dont understand how it can help me... MSDN : The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.
i dont even understand what its used for
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|
|
Hi,
I wrote a automation program, that uses word object library, to open .doc files and save it as .rtf files. It was not saving the Header/Footer information.
Any Suggestions?
Thanks.
GTS
|
|
|
|
|
I used this code and it retained headers/footers fine:
CString strFileName;
_Application app;
Documents docs;
_Document doc;
COleVariant vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
vtFalse((short) FALSE),
vtTrue((short) TRUE),
vtDoc((short) 0),
vtText((short) 2),
vtRtf((short) 6),
vtHtml((short) 8);
if (app.CreateDispatch("Word.Application") == TRUE)
{
docs = app.GetDocuments();
doc = docs.Open(COleVariant(strFileName), vtOptional,
vtOptional, vtOptional,
vtOptional, vtOptional,
vtOptional, vtOptional,
vtOptional, vtOptional,
vtOptional, vtOptional);
strFileName.Replace(".doc", ".rtf");
doc.SaveAs(COleVariant(strFileName),
vtRtf,
vtOptional,
vtOptional,
vtOptional,
vtOptional,
vtOptional,
vtOptional,
vtOptional,
vtOptional,
vtOptional);
docs.Close(vtFalse, vtOptional, vtOptional);
app.Quit(vtOptional, vtOptional, vtOptional);
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi David,
The header/footer appears while open with MS-Word, but the informations are not appear in WordPad.
Is there a compatibility issue? Do you have any idea how to get the header/footer information in wordpad?
Thanks.
GTS
|
|
|
|
|
From what I can tell, Wordpad does not even support headers/footers.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|