|
In your app's OnInitInstance() , call ShowWindow(SW_SHOWMAXIMIZED);
|
|
|
|
|
How can i disable to move a window??
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
Have you looked at the WM_GETMINMAXINFO message?
|
|
|
|
|
One solution is to add a handler for WM_SYSCOMMAND. Ignore SC_MOVE.
if (WM_SYSCOMMAND == message && SC_MOVE == (wParam & 0xFFF0))
return 0;
Kuphryn
|
|
|
|
|
thanks that worked pretty good
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
We have an MDI app where each MDI window has toolbars of its own (ie. there are multiple docking toolbars on the main frame wnd and at least one fixed position toolbar on the MDI child wnds). And all of the buttons, on all of the toolbars, have tooltips.
but...
When you start the program, the only tooltips that will show are those that belong to toolbars on the main frame wnd. The only way to make tooltips start working on the child wnds is to move the mouse over a separator on the child wnd toolbars first. After you do this, tooltips work fine for everything. Clicking buttons doesn't help, moving over enabled/disabled buttons doesn't help; the separator is the key. And, you don't have to hover over it, just a quick fly over on your way to a button will do it.
This is sub-optimal.
Any ideas?
CheeseWeasle
|
|
|
|
|
I am finding this returns -1 in all cases in my program on a Windows 2000 machine. However when I run exactly the same code on another computer with in Windows XP it works correctly and returns 0, 1, 2 etc...
I need this as I have to know which image is being dragged across from the ListCtrl to a TreeCtrl.
Sounds strange to a novice like me and anyone who has come across a solution please HELP!
Failing this if anyone has bright ideas on a better method nice to hear from ya.
Btw, the imagelist was inserted using the InsertItem(int, LPCTSTR) not that that should make a difference.
Thanks
Noel
|
|
|
|
|
Noel Mulvihill wrote:
I am finding this returns -1...
And "this" is???
|
|
|
|
|
Sry - 'this' refers to the function GetHotItem() called as part of OnLButtonDown() in my CListCtrl. When one clicks on an image list - I expect the index of the currently selected image (0,1,2.. etc) to be returned.
This happens when I run in XP, but not when I run in Win 2000 (I just get -1).
Ta,
N
|
|
|
|
|
I wonder if it could be a difference in the underlying common control?
|
|
|
|
|
I don't know. I sort of thought it might be linked in some way to messages given some problems with CListCtrl other people seem to have with - and it's mentioned in MS Knowledge Base in the following article "PRB: No ANSI Notifications from Control Created in OnCreate"(Article ID: Q148533).
I tried the solution in this article but it didn't seem to work and probably needs to be modified anyway - even if I am (somewhere!) on the right track.
|
|
|
|
|
Here is a simple one for those of you who did it before:
Let's say I know the exact path inside the registry to a certain key and I just need it's value, how do I read the registry ?
Thanks,
Shay
|
|
|
|
|
RegQueryValueEx() , or use CRegKey::QueryValue() .
|
|
|
|
|
First of all, thank you.
but can you be a bit more specific and give me a short example?
If I use RegEdit to look for the parameter I am interested in, it is located in: MyComputer\HKEY_LOCAL_MACHINE\System\
It's value is :HOME1
Type:REGSZ
How do I read it into a CString or a char *
Thanks again,
shay
|
|
|
|
|
Shay Harel wrote:
but can you be a bit more specific and give me a short example?
Did you read the MSDN documentation for the two functions I mentioned?
|
|
|
|
|
Yes but I have problems finding what is the lSize ?
|
|
|
|
|
|
<br />
CString strMainKey = "System\\controlset001\\Control\\session manager\\environment\\";<br />
CRegKey regKey;<br />
CString reg_read;<br />
long lRes;<br />
unsigned long lSize;<br />
<br />
if (m_str_log_name=="")<br />
{<br />
<br />
lRes = regKey.Open(HKEY_LOCAL_MACHINE, strMainKey,KEY_ALL_ACCESS);<br />
regKey.QueryValue(reg_read.GetBuffer(0), "SYMMHOME1", &lSize);<br />
regKey.Close();<br />
reg_read+="\\symmwin\diag6";<br />
<br />
}
I am almost there but the problem is that after I do:
reg_read+="\\symmwin\diag6";<br />
reg_read turns to be only "\\symmwin\diag6"........
any idea why ?
|
|
|
|
|
Per MSDN, the third parameter to QueryValue is:
"[in, out] The size of the string data. Its value is initially set to the size of the szValue buffer."
So, you need to initialize lSize to the size of reg_read . However, reg_read.GetBuffer(0) is pretty useless in this case. I would opt for another value besides 0. Something like 256 should be enough to hold the value.
lSize = 256;
lReturn = regKey.QueryValue(reg_read.GetBuffer(lSize), "SYMMHOME1", &lSize);
regKey.Close();
if (ERROR_SUCCESS != lReturn)
|
|
|
|
|
I want to drag drop files from my application to Windows Explorer. To accomplish this I use COleDropSource and COleDataSource together with clipboard format CF_HDROP. This works.
Now I would like to rename the file during the drag drop operation. From reading the MSDN documentation I think that I have to use the clipboard format identifier CFSTR_FILENAMEMAP as an additional format on the COleDataSource object. This format should contain the new name. But I can't get this to work. Nothing happens. Probably I'm specifying this wrong.
Has anybody done this before? An example or some extra information would be very helpfull.
|
|
|
|
|
I'm trying to create a server which accepts client connections.
....
Address.sin_family = AF_INET;
Address.sin_port = htons(1212);
Address.sin_addr.s_addr = htonl(INADDR_ANY);
IntReturn = bind(Listen, (struct sockaddr *) &Address, sizeof(Address));
IntReturn = listen(Listen, 10);
IntReturn = sizeof(RemoteAddress);
Client[Computer].ClientSocket=accept(Listen, (struct sockaddr *) &RemoteAddress, &IntReturn);
...
Clients from any! ip can connect to my server on port 1212..
My server should not accept connections from any ip, so how do I get my server to only accept connections from example 10.0.0.105 ?
I thought about changing this line
Address.sin_addr.s_addr = htonl(INADDR_ANY);
to
Address.sin_addr.s_addr = inet_addr("10.0.0.105");
but this does not work, am I doing something wrong?
Thanks
|
|
|
|
|
Use a firewall. Winsock doesn't support connection filtering.
|
|
|
|
|
Well, thats not an option, since I'm using it on a LAN.
|
|
|
|
|
Get IP from the connected client. Check if the IP is an accepted IP and if it's an accepted/allowed IP then start sending datta etc. if not, just disconnect the socket.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Hello
Does anyone knows a way to let CHtmlView open HTML pages with pictures in the TIFF format?
Thank you in advance
|
|
|
|