|
_AFXWIN_INLINE HWND CWnd::GetSafeHwnd() const
{ return this == NULL ? NULL : m_hWnd; }
in MFC\Include\AFXWIN2.INL
Yours,
Alois Kraus
|
|
|
|
|
Hi,
I'm having big problems trying to scroll a listbox in code. I can set the scrollbar ok, but I can't figure out how to scroll the text properly.
Can anybody suggest how i can instruct a CListBox to scroll by a given amount, and have the listbox take care of updating both the scrollbar and the client area (i.e. have it scroll the text correctly). Clearly CListBox knows how to do this, because if i just grab the scrollbar of a standard CListBox, it works. So how do i ask it to do this for me. Effectively, i want to 'emulate' having dragged the scrollbar.
Thanks
Jase
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows
Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
|
|
|
|
|
Have a look at LB_SETTOPINDEX / CListBox::SetTopIndex. These should help you.
Or you could simply send the listbox WM_VSCROLL messages.
Iain Clarke.
|
|
|
|
|
Sir, my computer is running under the proxy server. I want to developed application which is able to make http GET and POST request to a specified server.
C.R.Naik
|
|
|
|
|
Send GET/POST as usually, instead that you will connect your socket to proxy server instead of HTTP server. Headers will remail the same, in simple case (no proxy authorization ...)
rrrado
|
|
|
|
|
good behavior is also to send the complete url of the request, which is not necessary when using direct connection. Instead of
<br />
GET /index.htm HTTP/1.1<br />
Header: Value<br />
which is allowed for direct connecting, you should use the full syntax:
<br />
GET http:
Header: Value<br />
from this the proxy will be able to know, where you want to connect
|
|
|
|
|
I have modeless dialog windiw created in separate thread. Clicking to minimize button cause shrinking this window to size of title bar and it moves to bottom left corner of rhe desktop. How to minimize this window to task bar ? And show this window in task list so i could switch to this window by Alt+Tab ?
Thank you
rrrado
|
|
|
|
|
It sounds like you are using the WS_EX_TOOLWINDOW style.
What you will need to do is remove the WS_EX_TOOLWINDOW style in the SC_MINIMIZE portion of the WM_SYSCOMMAND message handler, and restore this style setting when the SC_RESTORE event is received in the WM_SYSCOMMAND handler.
The toolwindow prevents your windows from appearing in the Taskbar, however it also makes your windows minimize to the desktop like you have described.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I'm not using WS_EX_TOOLWINDOW style. It is ordinal dialog box window, i tried popup and also overlapped type, without any extended styles set in resource editor.
rrrado
|
|
|
|
|
Could you view your windows styles in Spy++ and let me know which styles both regular and EX that your window is using? That would help me figure out whats causing your problems.
Thanks
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Dialog style :
14CF0044 (WS_OVERLAPPEDWINDOW|WS_VISIBLE|WS_CLIPSIBLINGS|WS_OVERLAPPED|DS_3DLOOK|DS_SETFONT)
EXTENDED STYLES :
00010100 (WS_EX_LEFT|WS_EX_LTRREADING|WS_EX_RIGHTSCROLLBAR|WS_EX_WINDOWEDGE|WS_EX_CONTROLPARENT)
Parent window : NONE ( created with NULL parent window)
Thank you.
PS
I create more ot this modeless dialog windows, each in separate UI-thread. Another bug is that sometimes more of them are dreawn with active title bar, like when all of them would have focus set. So after creating of dialog i set focus for it, but it still happens rarely.
Thank you
rrrado
|
|
|
|
|
It looks like if you add the WS_EX_APPWINDOW style you will be all set!
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I tried to set WS_EX_APPWINDOW style, now it is in task bar next to main window, but windows is not able to switch to main window, it always switch to my dialog even if i click to main window in task bar
I will perhaps write my own window switching wihtin my application with ctrl-tab.
Thank you very much
rrrado
|
|
|
|
|
Hi,
how to disable Close button in titlebar of Popup window with minimize and maximize button enabled ?
Thanks
rrrado
|
|
|
|
|
In MFC:
CMenu* mnu = this->GetSystemMenu(FALSE);
mnu->ModifyMenu(SC_CLOSE, MF_BYCOMMAND ,MF_GRAYED);
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Thank you !
rrrado
|
|
|
|
|
Any pointers to implementations which compare two images ?
Thanks
|
|
|
|
|
I think it's just to read the bitmap data of the images and then compare the BITMAP structures(?)
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
load them into memory and memcmp ? alternatively, crc check the files ?
either of the above will work. could use some more information on what it is you're trying to achieve ...
Jase
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows
Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
|
|
|
|
|
Trying to find differences in two images?
Trying to determine if two images are of the same thing?
Trying to determine if two images are of the same scene?
What sort of comparison?
|
|
|
|
|
:Does anybody know how to add folders to a project, so that it gets displayed in the workspace on Visual C++ 6.0.
I know one can do it with the mouse, but I want to have my AppWizard do it according to the options the user has chosen. Are there any functions that I can call.
The only other way is to parse the .dsp file and add the folders there.
Franz Klein
|
|
|
|
|
hi, having trouble debugging my lil subroutine that encrypt and decrypt a buffer.
algorithm used is RC2 (8 BYTE PER BLOCK). HKEY derived from a passwd with MD5. API used:
(a) CryptEncrypt
(b) CryptDecrypt
The plaintext buffer going INTO CryptEncrypt was 28 BYTE (This means that u will have to call CryptEncrypt four times). The number of bytes in the returned encrypted buffer is 40 BYTE.
Now, i know that the encrypted buffer may be "up to a block size" larger than the plaintext buffer (according to MSDN). Since I called CryptEncrypt four times, the encrypted buffer can be as large as:
encrypted buffer size = 28 BYTE + 4 x 8 BYTE = 60 BYTE
QUESTION 1: Is this understanding correct?
QUESTION 2:
* RC2 used - 8 BYTE per Block.
* plain text buffer = 28 BYTEs
* return buffer = 40 BYTEs (Is this reasonable?)
Thanks.
norm
|
|
|
|
|
FACT 1: btw, just want to let you know that the error was:
(a) NTE_BAD_DATA
(b) seems like the length of the encrypted buffer is shorter than it should be and in the "final" pass - decryption - the buffer to be decrypted was NULL - thus leads to NTE_BAD_DATA.
FACT 2: however, NO error was reported from CryptEncrypt.
CryptEncrypt was called a few times to encrypt a buffer prior to calling CryptDecrypt. HOWEVER, the returned buffer does seems to be shorter than the indicated 32 BYTE (NOT 40). I can tell this by looking at the watch windows - but special characters in the encrypted buffer may cause to the situation in which not all byte/char in the encrypted buffer to be displayer. But i does look a lot shorter than 32 BYTEs
FACT 3: my decryption subroutine (which wraps around CryptDecrypt) successfully decrypted the first pass/block. Then from second block on, decryption was done, but I can see that it decrypted wrongly.
I cannot isolate the fault - the error may be on the encryption side, i may very well be on decryption side.
Thanks
norm
|
|
|
|
|
How can I multiple single instance application ?
Thank you for your kindness
|
|
|
|
|
Hi,
If I understood, you have some app, limited to be single instance and you want to run it simultaneously.
This is usually done by the creating some system-wide named resource, created by the first instance. Then other instances only check, if there such a resource exists. If yes, they exit immediatelly.
So in a generic way, you must avoid the second instance to find that resource, or remove the checking part of code.
But here I must mention, that this can have unpredictable results. At first, the designers of the app usually have some reason for implementing such a feature, second reason, forcing to close some handle, which application thinks is still open, may lead to crashes or some other odd results.
|
|
|
|