|
And how exactly would I do that?
|
|
|
|
|
By reading here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Anonymous wrote:
How do I make the window for my program non-resizable?
In Continuation with Mr Crow, you can also handle WM_GETMINMAXINFO message to do so
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
While that message does affect the frame's size, it does nothing for the cursor which would still indicate that the frame could be sized.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
So which way to go? Pros-n-cons?
|
|
|
|
|
Hi everyone,
I have a problem concerning the WM_LBUTTONDOWN message.
I'm subclassing a list view control using MFC to implement owner-draw abilities, and I'm using ON_WM_LBUTTONDOWN() in the message map.
BUT: When releasing the left button on the list view control nothing happens, the message handler only gets called when double-clicking the left mouse button...?
Any suggestions?
Alex
Don't try it, just do it!
|
|
|
|
|
Maybe the WM_LBUTTONDOWD got reflected to the parent of the control?
|
|
|
|
|
Doesn't reflection work the other way 'round? In other words, by default messages go to the control's owner and then reflection reflects them back to the control so that message handling can be done in derived control classes?
|
|
|
|
|
Yes, that is the definition of reflection.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Excuse me. Maybe it was HANDLED by the parent, in which case it will not be reflected back to the control. MFC handler processing code will typically stop at the first handler it finds. If you have a stub handler in your parent window you 'forgot' about, you can scratch your head a long time trying to figure out why the 'reflected' message is never received by the control.
|
|
|
|
|
If you're looking for clicks on the list control, you need to be handling LVN and NM messages such as NM_CLICK
|
|
|
|
|
I just tried this - handling the NM_CLICK message - at both the dialog and control level and it works in both cases.
|
|
|
|
|
Yeah, I will check NM_CLICK.
I've found out why WM_LBUTTONUP can't be received by MFC...
WM_LBUTTONDOWN: Processed in different ways depending on whether a click or drag operation is being initiated. To determine which operation is involved, the list-view control enters a modal message loop until either the button is released or the mouse is moved. (MSDN)
The message is only received if I move the mouse before releasing the button.
Thanks for all your quick answers,
Alex
Don't try it, just do it!
|
|
|
|
|
In that case, you should look into the LVN_BEGINDRAG message, which sounds like what you need.
|
|
|
|
|
By the way, I just looked at some old code of mine and saw that we handled WM_LBUTTONDOWN, WM_MOUSEMOVE, WM_LBUTTONUP and LVN_BEGINDRAG. We handled all these messages to have control over changing the mouse cursor to represent what was being moved or in some cases to display a shape that indicated something that could not be dragged. Handling these messages also enabled us to change the cursor to indicate a valid "drop zone".
|
|
|
|
|
Hi Folks,
I am using a Library (OpenCV) for image processing in Vc++ 6.0;
The problem i am getting in compiling the application is that when i compile my application it works fine but when i try to execut, it give error saying "highgui096.dll" not found re-installing may fix the problem;;;
when i copy this dll file to my project folder it runs. fine ;;;
tell me where to add path for this dll so it may be used in all projects....
Regards,
Bye
|
|
|
|
|
c:\Windows\system32 like all dll's. You must also include it in your installation set up.
|
|
|
|
|
The path is NOT \system for Win32!!!
It is system32, and also the windows path may be different to C:\Windows!!
(Can be C:\WINNT on Win2k, for example)
Don't try it, just do it!
|
|
|
|
|
See GetSystemDirectory
The GetSystemDirectory function retrieves the path of the system directory. The system directory contains system such files such as dynamic-link libraries, drivers, and font files.
|
|
|
|
|
This is your DLL or some other company? If you are creating an installation package is it not reccomended to put things into the "SYSTEM32" directory anymore. This is reserved for Windows System files and possibly other very specific files (See Microsoft for details "Services and device drivers should be placed in the system directory").
This is what is required if your application would like to have the "Designed for Windows" logo. However, even if you are not shooting for this logo is it best to read the requirements and use them as a "best practices" since it is what Microsoft is reccomending rather than randomly place files anywhere you want on the system.
Chapter 2[^]
Referr to "4. Install Shared Files to the Correct Locations" to determine where the correct location would be for your specific files.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
To be really hard core, create a folder under the 'Common Files' place your DLL there.
Then make an App Paths registry entry for your programs that need access to the DLL and have one of the folders for the App Paths entry be this common folder.
Problem solved, and logo compliant.
|
|
|
|
|
"Hard code" install
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Toby Opferman wrote:
8bc7c0ec02c0e404c0cc0680f7018827ebee
What does this Means
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
You will be sorry that you asked
This is actually the machine code of a program I wrote a long time ago. This is whole program and it was basically in "TINY" .COM format. The .COM format is a raw binary format that contains no headers and only raw binary code and data. The .COM is limited to 64k of memory - sizeof PSP - your stack.
The PSP was the first 256 bytes of the segment and at offset 100h (256) your raw binary code would be loaded. This file format's elegance of having no header information made it a perfect candidate for "lowest bytes" competitions. If you used to do the very small ones you know that you would ask what rules would need to be applied to the competition, such as:
1. Can I print garbage?
2. Can I assume certain registry values?
3. Can I use x or y interrupt?
4. Can I use this or that trick?
So, in MS DOS you could assume certain values of registers on entry. These were:
DI = FFFEh
SI = 100h
AX = 0
BX = 0
CX = 00FFh
The binary code that is in my signature looks like this in 16 bit:
8BC7 MOV AX,DI
C0EC02 SHR AH, 2
C0E404 SHL AH, 4
C0CC06 ROR AH, 6
80F701 XOR BH,01
8827 MOV [BX],AH
EBEE JMP 0100
"JMP 100" means jump back to the top of this program since 100h is the starting offset. So, without further evaluation of what this code is doing it looks like it's an infinite loop.
Let's examine what is going on though.
1. MOV AX, DI ; AX = DI = FFFEh
2. SHR AH, 2 ; AH = FF, AH>>2 = 6Fh
3. SHL AH, 4 ; AH = 6F, AH<<4 = F0h
4. ROR AH, 6 ; AH = F0, AH Rotate 6 = C3h
5. XOR BH, 1 ; BX = 0, BX = 100h
6. MOV [BX], AH ; BX = 100h, Ah = C3h, [100h] = C3h
7. Jmp to 100h (256)
So, what happens is that we take FFFEh into AX then we take the top half and do a few funny tricks just to confuse and eventually rotate the result into C3h.
Then what happens is the high byte of BX is set to 1 through the 0 xor 1 = 1 which makes BX = 256. We then move the value of AH into the memory location of 100h.
The final jump goes to 100h which now contains the value of C3h. You could say that if the cache isn't flushed it would contain the old value of MOV AX, DI however the JMP instruction should have flushed it.
In any case again we have another trick in that the Stack is said to be initialized to 0. C3h = RET instruction or Return which takes the address on the stack and jumps to that location. In this case, it's 0.
What's at 0? The PSP is at 0 and the first two bytes of the PSP is CD20 or "INT 20h" which was the original method of exiting a .COM application (preceeded by the .EXE method of INT 21h with function 4fh).
So that's it. The code is just self modifying code that does nothing but return.
On a side note, the extension of .COM and .EXE does not matter. The first two bytes of a .EXE (LE, NEHDR or PE format) are "MZ". The loader ignores ".COM" and ".EXE" and looks for these two bytes. If it finds them it attempts to load as a .EXE if not, then .COM. The only difference the .COM and .EXE extensions made was the loader looks for .COM first then .EXE. So if two applications named "x.com" and "x.exe" were in the same directory and you typed "x", "x.com" would be the only one executed. And it could even be in .EXE format!
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Nice Secret behind that Hexadecimal Number , I have preserved this post for ever in my personel BLOG .
Toby Opferman wrote:
You will be sorry that you asked
Nope,I am happy to know about it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|