|
Why would you want to use WS_EX_LAYERED? It would exclude like 90% (or more) of the Win32 platforms.
It might be cool, but it's unsupported on far more Win32 platforms (both in count of platforms and installations) than it's supported on.
|
|
|
|
|
Mike Nordell wrote:
Why would you want to use WS_EX_LAYERED? It would exclude like 90% (or more) of the Win32 platforms.
Well, that depends. If you are talking about all machines world-wide where some version of Windows is installed, yeah, that's probably correct. However, that is not everyone's market. If you are targeting a specific group of users (such as a corporation where all software is standardized) then this decision is much more relevant.
And although this is feature seems generally to be used for unnecessary gimicks, there are other uses for it; i recall one person posting here a while back who was designing a HUD that needed to be displayed over another piece of software.
--------
all the modern things
have always existed
they've just been waiting
to come out
and multiply
and take over Björk, The Modern Things
|
|
|
|
|
Eugene Polonsky wrote:
I looked in documentation for WS_EX_LAYERED, it says only top-level windows can have that attribute.
This is true. It is not really a problem however, since you generally have much more control over how child windows are drawn. GDI+ can help if you need routines for doing alpha blending.
That said, one hack i have used in the past is to create a top-level window, but manually position and move it like a child window. Obviously this is generally useless, but in a few specific situations i could see it.
--------
all the modern things
have always existed
they've just been waiting
to come out
and multiply
and take over Björk, The Modern Things
|
|
|
|
|
I'm making a dialog based MFC program and I want to use two dialogs... but I would like to close the first one before the second opens.
How should I do?
|
|
|
|
|
In your program's InitInstance() , after the first dialog has closed, create and show a new dialog.
--------
all the modern things
have always existed
they've just been waiting
to come out
and multiply
and take over Björk, The Modern Things
|
|
|
|
|
Shog9 wrote:
In your program's InitInstance(), after the first dialog has closed, create and show a new dialog.
This may have problems in dialog based apps. Because by defauly the main window is the first dialog. When you close it, it gets destroyed and MFC sorta takes this to mean that the main app has closed.
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
Yes, this seems to be true... Had to do a test proggy to figure out why.
Another one of those cases where MFC looks far more simple than it is...
--------
all the modern things
have always existed
they've just been waiting
to come out
and multiply
and take over Björk, The Modern Things
|
|
|
|
|
Shog9 wrote:
Yes, this seems to be true... Had to do a test proggy to figure out why.
Another one of those cases where MFC looks far more simple than it is...
Yeah, I had to find out the hard way too, though it was a couple of years ago
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
As Nish pointed out, my original solution does not work. I think there should be a way that it could work, but i haven't figured it out yet; if i do i'll reply again
Otherwise you can do this:
- Make your main dialog the dialog you wish to appear second
- In the main dialog's
OnInitDialog() , create and show the first dialog.
The first dialog will then appear, and when it closes, the main dialog will appear.
--------
all the modern things
have always existed
they've just been waiting
to come out
and multiply
and take over Björk, The Modern Things
|
|
|
|
|
That seems to be a very good idea, since that way you are not breaking the MFC stuff.
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
How can i make a dialog be created but hidden? (modal or modeless does not matter).
I want someting as simple as this: Create a Dialog Mfc application and make it create the dialog hidden (so i put a tray icon) ive tried to put showwindow(SW_HIDE) in lots of events but none work, finally i did sometinhg in OnPaint, put the Dialog still show for a fraction os a second(like a flash, wich is ugly)
Thank you
|
|
|
|
|
To make a modeless dialog hidden, just use SW_HIDE in the ShowWindow call.
Modal dialogs, it is tougher and even the available solutions result in a momentary flash.
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
In the OnPaint Method
void CRcmmsv1Dlg::OnPaint()
{
ShowWindow(SW_HIDE);
if (IsIconic() {
...
..
}
It would work
|
|
|
|
|
you can find this in Mike Dunn's FAQ.
http://www.codeproject.com/cpp/cppforumfaq.asp
Gaurika Wijeratne. // www.gaurika.com
|
|
|
|
|
How does one make a program with which the user can press an "Imput" button to brows their computer for a certain file, press a "Run" button to run it through another program which then produces an output into a directory they choose by pressing an "Output" button. Sounds simple, but being just a beginner, I just have no clue.
|
|
|
|
|
Use GetOpenFilename() to select a file, use CreateProcess() to run a program (pass the file as a command line argument), and see this article for one way to select a folder.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hey Guys
I am using closehandle to close a file handle and it returns FALSE so therefore means its failed but when i do get last error it says operation completed successsfully. Any ideas?
Im don't think a later function overwrites the lasterror either since it is only closing a handle. I might be wrong
Peter
|
|
|
|
|
Use GetLastError() and FormatMessage() . If you want, just make your code display the result of GetLastError() and use Error Lookup to see the corresponding message.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
|
Yeah, and i used it to write to a file with no problems.
I also formated the message and viewed the last error and it says operation completed successfully
Peter
|
|
|
|
|
the following code works great on win98 but on win2000 i get the error
Cannot Delete File: Cannot read from the source file or disk.
The program resides on a network drive and is shared between the 98 and 2000 machine. I have debugged dirname and it is the same on both machines.
thank you for any help.
wsprintf(dirname,"%s\\%s%s",Td.Dest_Dir,GetSubDir(),"\0");
HANDLE hFind = FindFirstFile(dirname,&FindFileData);
if(hFind != INVALID_HANDLE_VALUE && FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY){
SHFILEOPSTRUCT shf;
memset(&shf,0,sizeof(shf));
shf.hwnd = selcompany::GetSafeHwnd();
shf.wFunc = FO_DELETE;
shf.pFrom = dirname;
shf.pTo = "\0\0";//NULL;
shf.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION;
shf.fAnyOperationsAborted = FALSE;
shf.hNameMappings = NULL;
shf.lpszProgressTitle = " ";
if(SHFileOperation(&shf)==0){
//////////////////////clear vars reset window
}
}else{
////////////not valid .....
}
|
|
|
|
|
Forget about it, this anwer was obviously wrong.
shf.lpszProgressTitle = " "; I don't konw if this is the reason of your problem, but I think it should be
shf.lpszProgressTitle = L" ";
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Do you have WRITE permissions on the share?
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
You cannot sprintf a null character using %s, because "\0" looks the same as "", which is no characters at all. You'll need to put the extra null char there yourself - I usually zero out the entire buffer beforehand so I don't have to worry about finding the exact end of the string and tacking on an extra 0.
--Mike--
Buy me stuff!
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|