|
I need a view get the size of a formview, not the form size to the view.
I know the second option is using RecalcLayout and ResizeParentToFit, and the first option how?
Thanks.
|
|
|
|
|
Hi
I was wondering about the desktop and settings for it. I haven't really played about with things like this before, so maybe some of you who have could point me in the right direction?
I was thinking that it would be kind of cool to have a script that runs on startup to change the desktop background randomly, based on pictures in a particular folder. Is this silly / impossible, or is it a simple concept that I should have learned at the same time as learning to semi-colon and somehow missed out on?
Thanks for any ideas / pointers in the right direction.
ps. I would like to write the script myself, rather than download an exe utility. Thanks!
I knew it would end badly when I first met Chris in a Canberra alleyway and he said 'try some - it won't hurt you'.....
- Christian Graus on Code Project outages
|
|
|
|
|
This is reasonably easy to do using SystemParametersInfo() . Specifically, see SPI_SETDESKPATTERN and SPI_SETDESKWALLPAPER .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks - looking forward to getting it working
I knew it would end badly when I first met Chris in a Canberra alleyway and he said 'try some - it won't hurt you'.....
- Christian Graus on Code Project outages
|
|
|
|
|
|
Thanks!
I knew it would end badly when I first met Chris in a Canberra alleyway and he said 'try some - it won't hurt you'.....
- Christian Graus on Code Project outages
|
|
|
|
|
Is it possible to create a hook for a MS DOS program? I wish to hook NT's net.send function that you can use under CMD (I assume it stands for command).
For those who are wondering, I wish to block out which computer sends the message. My school frowns on sending messages, and I wish for a little more impunity!
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
There is a way to hook API calls for all processes in the system. You must first write a DLL and get it loaded (possible using a global message hook) in all processes. Then, it's possible to hook functions using APIHijack, which can be found I think here on CodeProject. The function you will want to hook is called NetMessageBufferSend, located in NetApi32.dll, which is what the "net send" command uses I'm sure.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Or maybe it would be easier just to write your own program which would call NetMessageBufferSend, and pass some bogus name for the "fromname" parameter.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Cool, I didn't know about that function Works for me! Do you know what the parameter ServerName needs? An IP address? Also, what is Msgname? I assume the par. buf is the actual message.
Thanks VERY much,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Unless you want the function to execute on some other machine (which the ServerName would be the name or IP address of), you can pass NULL for the ServerName parameter. Indeed, the parameter buf is the message.
Selevercin wrote:
Thanks VERY much
No problem
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Sorry, but one last question. For the second parameter (Send To) it wants a constant unsigned short pointer. I have no idea what to do for this. I feel like I should put in a string with the computer name of which I'm sending to. Any ideas?
Thanks again,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
It's a wide character string specifying either the name of the computer to send to, or the IP address of the computer to send to. So, you could do something like this to send it to IP address 127.0.0.1 (your own computer):
NetMessageBufferSend( NULL,
L"127.0.0.1",
L"Bogus FromName",
(BYTE*)L"123",
6 );
The L character in front of the strings specifies that you want the string to be a wide character string. Note that the example isn't a real world example, it's just meant to show the simplest way to do it.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Ok, first let me appologize for being stupid. I can't figure out how to get an edit box to input wide characters. Do I need to start out as a string, then convert it to wide characters?
Thanks, again I appologize for being stupid,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
I edited this because it wasn't entirely accurate...
You don't have to apologize. Here's a sample of how to convert from a "TCHAR" string that the CString uses (which can be char or wchar_t), like you can get from the edit control, to a "whar_t" string, like the NetMessageBufferSend function expects:
CString a_sThisCameFromTheEditControl = "127.0.0.1";
wchar_t a_uszWillBePassedToTheFunction[128] = {0};
MultiByteToWideChar( CP_ACP, 0, a_sThisCameFromTheEditControl, -1, a_uszWillBePassedToTheFunction, sizeof( a_uszWillBePassedToTheFunction ) );
I'm not sure what will happen if you do a UNICODE build of your application though...
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Very cool! It all compiles! I can't wait to try it out (I'm not on a network here at home).
Thanks very much,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
How do I open a named object (memory mapping) created in a service from a user session app?
prefixing with
"Global\" ?
|
|
|
|
|
See OpenFileMapping()[^]
If you're not using Terminal Services, as the above link states, then "Global\" would be ignored.
|
|
|
|
|
ian mariano wrote:
If you're not using Terminal Services, as the above link states, then "Global\" would be ignored.
...unless you are running on NT4. There the global prefix would cause an error!
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
My menu works fine until I make a new child... then the menu changes to the 2nd one and I lose all changes to the menu.
How can I detect the change of menus to the one used with MDI children active, so I can update the 2nd menu?
Or is there a better way of dealing with this? Modify both menus at once when needed? If so then how? I didn't find any referenches to the 2nd one.
|
|
|
|
|
I m developing an SDI application derived from class CView in MFC. I have to change the color of whole window which includes Menus,Frame Window & Client Area. I am succeed in changing the color of client area of SDI & Toolbar, but I don't know that how can I change the colors of Frame Window & Menus.
Is there any way to change the colors of Frame Window & Menus.
awaiting for reply.
regards,
M. Usman Ghani Khan
|
|
|
|
|
One solution is to derive a class from CFrameWnd and paint the frame. The same concept works for menu.
Kuphryn
|
|
|
|
|
hello.
i have overriden WindowProc for CButton-derived control and handle WM_MOUSEMOVE message
in message handler i call ::SetCursorPos
all i want to know is: does ::SetCursorPos function send WM_MOUSEMOVE message or not?
thanks in advance
nobody is perfect
|
|
|
|
|
AFIAK it sends the WM_MOUSEMOVE message to the window that contains the cursor's new position, but not to the window that contains the cursors old position.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
what about SetCapture?
nobody is perfect
|
|
|
|