|
|
haha, very easy.
1.) Right-click on the .txt file,
2.) Choose "Properties",
3.) Choose "Browse",
4.) Then choose your program name, ie. myprogram.exe
Enjoy
|
|
|
|
|
|
36 hours straight and my mind is starting to go blank. What is a quick and easy way to convert a string to a DWORD? The string is an 8 char representation of a hash value, I will use it as a key in the registry.
|
|
|
|
|
wow, I didn't even realise this set of functions existed, and here's me thinking of bit shifting!!
dwKey = strtoul(key,0,16);
|
|
|
|
|
Hello
I am trying to keep a window within a certain bounding rect. So far I am capturing the WM_ENTERSIZEMOVE message within the window procedure and doing this:
boundry is the program defined rect that the user should stay within.
pt is the mouse POINT.
rect is the window RECt.
<br />
test.left = boundry.left + ( pt.x - rect.left );<br />
test.right = boundry.right - ( rect.right - pt.x );<br />
<br />
test.top = boundry.top + ( pt.y - rect.top );<br />
test.bottom = boundry.bottom - ( rect.bottom - pt.y );<br />
<br />
ClipCursor( &test );
There are a few problems that arise, one of them is that depending on where i grab the window, the resulting boundry rect is sometimes off by as much as a few pixels.
Whats the dilly?
|
|
|
|
|
Didn't you ask this question the other day? And didn't I recomend using the WM_GETMINMAXINFO rather than trying to do it manually. And did it work?
|
|
|
|
|
Yah I did, And no I couldn't get it to work properly. It was only working for the resizing of the window, not the moving. This is what i wrote:
<br />
<br />
case WM_GETMINMAXINFO:<br />
<br />
<br />
wndInfo = (MINMAXINFO *)lParam;<br />
<br />
wndInfo->ptMaxPosition.x = boundry.left;<br />
wndInfo->ptMaxPosition.y = boundry.top;<br />
<br />
wndInfo->ptMaxSize.x = boundry.right - boundry.left;<br />
wndInfo->ptMaxSize.y = boundry.bottom - boundry.top;<br />
<br />
wndInfo->ptMaxTrackSize.x = boundry.right;<br />
wndInfo->ptMaxTrackSize.y = boundry.bottom;<br />
<br />
wndInfo->ptMinTrackSize.x = boundry.left;<br />
wndInfo->ptMinTrackSize.y = boundry.top;<br />
<br />
ret = 0;<br />
break;
Was I missing somthing?
|
|
|
|
|
Maybe this[^] will help you.
|
|
|
|
|
Thanks for the article, It seems that only the resizing is being handled though, not the moving.
|
|
|
|
|
Well I ended up going about it this way, now i just need to figure out how to stop the cursor from moving in the case that it goes within the if statements, any ideas?
case WM_SIZING:<br />
case WM_MOVING:<br />
winRect = (RECT *) lParam;<br />
<br />
winWidth = winRect->right - winRect->left;<br />
winHeight = winRect->bottom - winRect->top;<br />
<br />
if ( winRect->left < boundry.left )<br />
{<br />
winRect->left = boundry.left;<br />
if ( Msg == WM_MOVING ) winRect->right = winRect->left + winWidth;<br />
}<br />
<br />
if ( winRect->top < boundry.top )<br />
{<br />
winRect->top = boundry.top;<br />
if ( Msg == WM_MOVING ) winRect->bottom = winRect->top + winHeight;<br />
}<br />
<br />
if ( winRect->bottom > boundry.bottom )<br />
{<br />
winRect->bottom = boundry.bottom;<br />
if ( Msg == WM_MOVING ) winRect->top = winRect->bottom - winHeight;<br />
}<br />
<br />
if ( winRect->right > boundry.right )<br />
{<br />
winRect->right = boundry.right;<br />
if ( Msg == WM_MOVING ) winRect->left = winRect->right - winWidth;<br />
}<br />
<br />
counter++;<br />
sprintf( buffer2, "In WM_SIZING/WM_MOVING this many times: %d", counter );<br />
charCount = SetWindowText( hWnd, buffer2 );<br />
<br />
return true;
Thanks,
Ben.
|
|
|
|
|
you're asking for Managed C++.
ask this in the C++/CLI forum[^] instead.
|
|
|
|
|
Hi toxcct,
Wheres question?
|
|
|
|
|
When i try to make an object from the CGridCtrl class as follows: CGridCtrl grid;
I get this error:
"unresolved external symbol "public: __thiscall CGridCtrl::CGridCtrl(int,int,int,int)" (??0CGridCtrl@@QAE@HHHH@Z) referenced in function "public: void __thiscall CSpreadSheetView::CreateGrid(void)" (?CreateGrid@CSpreadSheetView@@QAEXXZ)"
How could this be solved?
|
|
|
|
|
did you correctly added all the files into Visual C++ ?
|
|
|
|
|
And also make sure that CGridCtrl::CGridCtrl(int,int,int,int) has been "declared".
|
|
|
|
|
it is... the CGridCtrl is a class made by Chris Maunder available somewhere here on Codeproject.
|
|
|
|
|
Is there any way of creating a console program that runs without the user noticing? SOmething like a invisible console? I've seen an article that taught to do this, somewhere in CP, but I can't find it anymore..
|
|
|
|
|
Would ShellExecut() do it?
|
|
|
|
|
The simplest way to do that I've found is to create a normal Windows application (one with a WinMain function), and then don't create a window.
Software Zen: delete this;
|
|
|
|
|
|
Hey,
I've an application with 2 dialogs. The first dialog holds a couple of controls, the second dialog a listbox with handles to the controls (on the first dialog).
Now I want to set the focus to the control on the first dialog by selecting an item in the listbox. My problem is that the focus jumps back to my listbox after I set it to the control.
Code after selecting an item in listbox (all pointers are valid!)
<br />
CWnd* pWnd = GetHandleToDialogControl(iIndex);
pWnd->SetFocus()
I can see that the control get the focus, but it jumps back to listbox immediately...
|
|
|
|
|
You might try using PostMessage to send a user-defined message from the second dialog to the first in your listbox notification handler. This should let the focus handling in the list box complete, and then your user-defined message would reach the first dialog, which could then set the focus as desired.
Software Zen: delete this;
|
|
|
|
|
Where is this code located? In OnInitDialog()? If so, make sure you return FALSE from the OnInitDialog() function. If not, the system will give the first control in the dialog the focus (which may not be the control you have given focus).
--
Nominated For Three Glemmys
|
|
|
|
|
Having two dialogs communicate in this fashion indicates a very bad design. They should be using PostMessage() to communicate with each other.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|