|
Hello,
I dont normally ask stuff like this, but I haven't been able to find an answer anywhere
I'm writing an app in windows(MFC) (I have what I think is at _least_ a basic understanding of writing these things, but windows programming is not my forte)
I'm looking to find mouse coordinates in the client area, an easy task you might think...
But alas, no.
The app has 5 ctrl bars dotted about, 2 of which start docked to the sides, and 1 toolbar/ctrlbar, which starts docked to the top. I can access the ctrl bars and do stuff when buttons are clicked and sliders are slid.
hmmm. lets say its a paint app (NDA's etc :/)
what i want to do is pick a tool from the ctrl bar, which i can do, and draw onto the main white bit of the window(the client area, if im correct).
But, because I've got docked things, ScreentoClient doesnt work the way I'd like it to:
GetCursorPos(&c);
ScreenToClient(AfxGetMainWnd()->m_hWnd, &c);
This doesn't return the cursor relative to the TopLeft of the white bit, but to the point below the menubar, where I assume the windows actual client area starts.
So I supose what I'm asking is how do I get the TL corner of the white area? or even if it has different name, what is it called, so I can at least look for the right thing, clientArea isnt tuning up much for me.
I hope that all made sense to someone at least.
Thanks in advance to anyone who takes the time to look at this.
|
|
|
|
|
Sorted it now, turns out that the white bit was a seperate child window or similar, not too sure. I:m building off of some other code.
But it works now, and thats what matters
|
|
|
|
|
Does anyone know where i could get a copy of it?
my copy of VS doesnt seem to come with it.
|
|
|
|
|
tried google?
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
That question is getting kinda annoying,
if i hadnt tried google first then why i post here first?
http://www.google.com/search?q=windowsx.txt&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8
do you see anything helpful ?
i see a microsoft artical( doesnt provde much info ), and some non-relative links
|
|
|
|
|
www.ticalc.org/archives/files/fileinfo/345/34562.html [^]
Maybe it's this?
I'm sorry if you're getting annoyed,but I'm only trying to help!
I usually find files by searching google on filename + download
Hope this link is what you're looking for.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
no, thats a prog someone wrote for TI-83 Graphing Calc's
although it does have a document name windowsx.txt it was written by the person who wrote the prog and is not the document im looking for
the windowsx.txt file im looking for is a microsoft sdk document with details about Message Crackers
ie. HANDLE_MSG()
|
|
|
|
|
When I use the CSliderCtrl control ,set the style as vertical,
But get the upper position is small and lower position is big,
How can I set as the lower big and upper small?
Thanks!!!
Nothing ,nothing ,I am a leaner.
|
|
|
|
|
hi,
I want to zoom in and zoom out a bitmap.
how can i do this
any sample ,, or help.
thanx
|
|
|
|
|
http://www.codeproject.com/miscctrl/wndimg.asp[^]
The referenced article uses StretchBlt() to scale the image.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hi , thanx for guiding me .
But i m not getting any clue from this.
I only want to zoom it ,,ur sample application is doing many things
i m confused with this
waitng for more prompt answer
thanx
|
|
|
|
|
If you want to zoom a bitmap, that is the same as stretching it. So use the StretchBlt() function. By specifying the destination coordinates to be larger than the source coordinates you will get the effect of zooming in. By making the destination coordinates smaller than the source coordinates you get the effect of zooming out.
Look up StretchBlt() (or CDC::StretchBlt() ) in MSDN for more information.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
hi all!!
i have a small problem. i have designed an application which uses MS-ACCESS to log data. now, my application can be started only by administrator. when i log in as any other user other than the administrator my application will not start. but if i had started it as administrator and then logged in as any other user, it should run. The application no doubtedly runs but the the logging does not happen. i think this happens because, the databse gets closed when i log off as administrator. is there any way that i log off but the database does not close. or any other solution that u ppl can suggest me.
|
|
|
|
|
are you sure, your app is running after logout??
is it a normal windows app? I'm sure, all user-apps are killed on logof.
|
|
|
|
|
my application is interfaced to a driver that i have written. the application is destroyed no doubt. but the driver is not until shut down. so when i log in i re-create the user-land windows application. will event log work in my case instead of database?
|
|
|
|
|
I wrote a service, and this service has some connections to a access-databse and a ms-sql server database... and it works quite well.
so... theoreticly.. your approach should work
|
|
|
|
|
Hello,
Which is better?
ADO by Importing ADODLL and _ConnectionPtr and...
or
DAO
using CDaoDatabase and...
Best Wishes.
Thanks.
|
|
|
|
|
ADO. Better yet, use raw OLEDB.
|
|
|
|
|
Ok, in most of the Open/Save dialogs i see professional programs using it has 5 buttons on the left side (History, Desktop, My Documents, My Computer, and My Networking places)
i am already familiar with how to use the CFileDialog class, but i cant get those buttons to show up, so is just becuase i havn't found the right parameter to add, or does MFC just not offer a template class for that?
|
|
|
|
|
I believe all you have to do is #define _WIN32_WINNT 0x0500 in your stdafx.h file. Just be aware that your app will not work on Win9x or NT4 if you do.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
I believe all you have to do is #define _WIN32_WINNT 0x0500 in your stdafx.h file.
This won't work because the MFC libraries and DLLs have the old size of the OPENFILENAME structure (76 bytes vs. 88 bytes) compiled in.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
You cannot use CFileDialog for this. You must use GetOpenFileName() to get the "Places" bar. Just remember to omit the OFN_ENABLEHOOK flag. Its presence will cause the "Places" bar to not show up.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does anyone know how to redirect the dial button message in Outlook, so that it will call a custom dialer other than the 'standard' dialer.
Happy programming!!
|
|
|
|
|
Seems you want to introduce a functionality of your own to an existing event handler of a button right ? If i am right you have to write COM based plug ins for Outlook . I did it long back . But a perfect example is available here at CP itself if i remember well. you may search in PlugIn section ..
cheers
regds
dharani babu s
|
|
|
|
|
Hi
I want to write a console based simple application. Which on executing gives the name of all printers that are currently connected to network.
The function to do that is EnumPrinter and it's prototype is as :
BOOL EnumPrinters(
DWORD Flags, // printer object types
LPTSTR Name, // name of printer object
DWORD Level, // information level
LPBYTE pPrinterEnum, // printer information buffer
DWORD cbBuf, // size of printer information buffer
LPDWORD pcbNeeded, // bytes received or required
LPDWORD pcReturned // number of printers enumerated
);
Can any one plz give me exact example of how to do this ?
Thank you
Mahesh
|
|
|
|