|
I presumed he meant he didn't want to open every single file with an arbritary file format. If you want to find something inside a file you are going to have to look inside it somehow.
|
|
|
|
|
|
After getting fed up of creating code to center a window correctly, I have finally gotton around to developing a re-usable class to do all the nitty gritty calculations for me. I pass in a desired width and height, it returns a rectangle centered to the screen. Why bother do I hear you say? How often did you take the taskbar into account when positioning a window?
Anyway, regarding the sidebar in vista, and probably XP soon, finding the window and getting it's rectangle is simple enough. But the sidebar comes with other options, like it's ability to always be on top and it's ability to hide ( or rather move of screen ).
Now first proplem, how can I detect if the sidebar is "on top" ( it's pinned to the edge of the screen and all maximized windows maximize to it's edge ) or if it's "on bottom" ( it sit's on the desktop only and other windows may cover it ).
Second, how to detect if it's on the screen, hidden or not it always has a rectangle of the same size. When it's hidden it's rectangle moves/animates off the screen, it's top edge becoming equal to the desktops bottom edge. A simple comparison of those edges should suffice, but what about mulitple-monitor desktops. If the monitors were arranged in such a way that another is below the desktop, it would appear on that monitor.
|
|
|
|
|
NM. The answer was staring me in the face, literally. I was looking in the registry wheras I needed to check for the WS_EX_TOPMOST flag.
While I have this thread though, Can anybody think of any other windows that have a pinning ability and that may effect the correct centering of a window.
|
|
|
|
|
This is just a guess, but the sidebar is probably implemented as an appbar. All appbars have the potential to change the area available on the monitor for other windows. If you always use the work area of a monitor as the rect to center against, your code will always work no matter what app bars are present.
|
|
|
|
|
Thanks for that, and you were right. I simple call to SystemParametersInfo() did the trick.
|
|
|
|
|
Hello
All
I want to copy String table in one application to other application so how string tabe copy to other application.
Thanks And Regards
Atool
Atool
|
|
|
|
|
If by 'string tabe' you mean the string table stored in the resources, then use the resource functions to accquire access to them.
Load the application with LoadLibrary() then find a resource with FindResource() or one of the EnumerateResource***() functions.
|
|
|
|
|
Ohhh no
I want to copy string table manually from one application to other.
Thanks and Regards
Atool
Atool
|
|
|
|
|
what's wrong with a copy and paste? or even open both files in VS and drag the contents over?
|
|
|
|
|
whats the best way to get environmental variables like %windir% %userprofile% and so on?
i've tried the above but vc++ 6.0 dont recognize them when for instance doing something like this:
CString MyVar;
MyVar = "%windir";
MessageBox(MyVar,"titletext");
..returns "%windir%" in the messagebox not "C:"
there may be a simple solution but i cant find it.
anyone?
thanx!
|
|
|
|
|
hobbyprogrammer wrote: whats the best way to get environmental variables like %windir% %userprofile% and so on?
Try GetEnvironmentVariable (VC++) or getenv (C++)
|
|
|
|
|
You need to convert the %***% to a real path before you can use it as a path. Try ExpandEnvironmentStrings()
|
|
|
|
|
Hai all,
class a
{
virtual ~a () { };
}
class b : a
{
~b () {}
}
if a class defined as in above, defined as in below
a *pa = new b ();
delete a;
then, how the virtual table created by compiler for this?
Ravindra M
+919849760694
|
|
|
|
|
What do you want to know exactly ?
In the case that you described, then the destructor of b will get called when you delete pa (I think you made a typo and wanted to write 'delete pa' instead of 'delete a').
(And please use the pre tag when you post code)
|
|
|
|
|
Hai Cédric Moonen,
Thanx for your reply. Internal process i.e., how the process knows b is supposed to be destroyed first and then a. can u explain?
Ravindra
Ravindra M
+919849760694
|
|
|
|
|
Maybe this[^] will answer your questions.
|
|
|
|
|
Could someone please help me with the following problem:
1. Within a modal dialog I trap an edit control's ON_EN_CHANGE message
which brings up a modeless dialog with a CListCtrl on it.
2. Depending on the text of the edit control an item is selected and
brought to the top of the list with the CListCtrl::Scroll function.
The item is now selected and has got the focus.
3. If I before any mosue interaction press the down arrow key the
first item is selected and NOT the next item which is what I want.
I urgently need to solve this problem so I put my hopes to code project.
Thanks
Lars
|
|
|
|
|
It sounds like in addition to scrolling to the item, you need to select the item as well.
|
|
|
|
|
Hi Mark,
Thank you for your reply.
However I have selected it with:
m_pModelessDialog->m_cListCtrl.SetItemState( nIndex, LVIS_SELECTED, LVIS_SELECTED );
m_pModelessDialog->m_cListCtrl.EnsureVisible( nIndex, FALSE );
Do you have another suggestion???
Thanks and regards
Lars
|
|
|
|
|
Oh ok
What if you also set LVIS_FOCUSED?
|
|
|
|
|
Mark,
Thanks for your suggestion but unfortunately that does not work either.
Any other idé?
Regards
Lars
|
|
|
|
|
program using MFC BUTTONS
PRA
|
|
|
|
|
wrote: program using MFC BUTTONS
ok
nave
|
|
|
|
|
Then we need to guess your problem?;)
|
|
|
|