|
|
I got a request to make a program that seamlessly writes out some generic info on the background on a Windows 2000 (or higher) machine. (info is such as quote of the hour, fre RAM, incoming mails, current song in Winamp, whaterver info that can be summarized in short strings, you get the idea)
Well, such a program needs a few properties: Transparancy, Not able to be activated, not show up in the taskbar. More ofcourse, but for now these are the important ones.
Trancaparency is easely fixed, just a layered window WS_EX_LAYERED with a call to the SetLayeredWindowAttributes function and selecting a COLORREF color to be treated as transparent.
Also giving it the WS_EX_NOACTIVATE style unables the windows to be in the foreground. And making it not able to show up in the taskbar, well, a toolbar have that property, so giving it the
WS_EX_TOOLWINDOW style solves that problem.
Now the part that I cannot solve remains, how to make the border, and most importantly, the titlebar to dissapear? (no x-shutdown icon isn't a problem, just use the commandline and send a shutdown mesage or something)
But for it to fit nicely onto the desktop background I need to remove the titlebar and border. Anyone who knows ?
// Christoffer Sandberg , christoffer_sandberg@hotmail
|
|
|
|
|
Well, if you are using the dialog editor from vc++, just change the border style to 'none' using the dialog properties 'styles' tab.... or with c++ code, call the ModifyStyle(WS_OVERLAPPEDWINDOW, 0, SWP_FRAMECHANGED) of your window class, and you have a window without any frame!
----
Rui Lopes
|
|
|
|
|
Ahh, that is indeed a neat function, unfortenatly is is a member of the CWindow class (ATL) or the CWnd (MFC)(atleast what I was able to figure out). What I have is a standard Win32 program (none ATL, none MFC) application, so I use the RegisterClassEx and CreateWindowEx functions in the API to do my work, so all I have access to is the hInstance and hWnd of the program/window. Is there anyway to go from there and still being able to remove the the WS_OVERLAPPEDWINDOW style?
|
|
|
|
|
Well, the ModifyStyle is a straitforward function to implement.
Use this code instead of the ModifyWindow,
<br />
SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE)&~WS_OVERLAPPEDWINDOW);<br />
<br />
::SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_FRAMECHANGED);<br />
But since you are using the CreateWindowEx, you can create the window without the WS_OVERLAPPEDWINDOW style, so there is no need for this code....
----
Rui Lopes
|
|
|
|
|
How does one pass the parent dialog box's handle to the contructor of a child dialog box that it creates?
I need to access the public methods of the parent dialog box from the child dialog box.
Thanks.
|
|
|
|
|
When you create the child dialog, pass the pointer of the parent dialog For example, call this from a parent dialog
void CParentDlg::SomeFunc()
{
CChildDlg dlg(this);
dlg.DoModal();
.
.
}
Now call GetParent() to access the parent dialog
CParentDlg* pParentWnd = (CParentDlg*)GetParent(); Now use pParentWnd to access the public functions from child dialog
Hope this helps
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
|
Hello, the codegurus around the world.;)
GetParent() is one way, but not so much technically.
So, pass the handle of parent of the constructor.
CChildDlg dlg (this);
dlg.DoModal();
And the constructor of CChildDlg;
ChildDlg::ChildDlg (CWnd* pWnd)
{
ASSERT(pWnd);
m_pParent = pWnd;
}
Good Luck!
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
- Are there any Linux disscussion boards?
- Please tell me the URL.
- Regards,
Maer
|
|
|
|
|
billions of them. Thats the big thing with Linux, the information you need is spread across a million sites and in an order that the best search engines in the world can't manage.
I'm not anti-linux at all, I use it at home and at work, but I sometimes wish a proper professional company would get hold of it and sort it out a bit.
Before any Linux gurus write in to give me a hammering, I've been a unix man since 1979 (developer), and linux since it was born, my argument is not with the product but with the the well just about everything else about it.
There, I've said my piece.
http://www.mandrakesoft.com leads to some discussion groups and tutorials, there are some very good programming tutorials too.
Also, don't forget news groups, there's about 20 billion billion of those. I lie not. Not often anyway.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Rassman wrote:
I sometimes wish a proper professional company would get hold of it and sort it out a bit.
Yeah, wouldn't it be great if somebody like IBM got involved in developing Linux...
|
|
|
|
|
Personally I'd rather see a Microsoft Linux. The only way we'll get any decent tools and resources that do things that we want them to do and not what some lame brained hacker thinks is a cool idea
Michael
|
|
|
|
|
Dead right there. A typical example was a Developer tool which was close to being like MS developers programming environment, when you first look its brilliant then you find the other half of it, the part that makes it useable, costs two arms one leg and a bag of marbles.
I am used to programming in vi editors, and having other windows open for make etc, but it would be so nice if I could do it all in one place.
But, in linux's favour I would say that, as with unix, its a very uncluttered environment. Mainly because it doesn't have to come out of the box ready to work in all environments in as automated a way as possible. So, if you do have a mojor number crunching maths modeling job to do, a Linux is great for that. Add Samba and you have an effective NT server so its easy to feed it data, let it chew it a while, then pick up the results.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
I totally agree. Microsoft makes very little money off the OS as compared to their other projects, particularly office. I think the antitrust trial should relegate them to no longer having their own OS, and everyone just uses the Linux kernel. It would help Microsoft sell stuff for other platforms, thus increasing their market, while not allowing them to leverage their monopolistic powers. I think it's a win for everyone...
But Microsoft is doing some work on FreeBSD (Rotor project: C# to another platform) FreeBSD is also not seen as a cancer because it doesn't use the GPL.
|
|
|
|
|
Linux experts are old-fashioned, we prefer mailing lists and newsgroups to WWW discussion boards. If you have already chosen a particular Linux distribution, see the distribution's home page for links to resources.
|
|
|
|
|
try linuxdoc.org - not a discussion board but full of information.
What do you need help with?
|
|
|
|
|
- Thanks pal!
- The web site "www.linuxdoc.org" is excellent!
- Are there any disscussion boards that I can use?
-Regards,
Maer
|
|
|
|
|
I've tried to register an OCX using regsrv32, but my program still won't show the control as it keep saying "An unsupported operations was attempted"
I'm using Microsoft FlexGrid 6.0 control in my program
.. anyone help meee
|
|
|
|
|
Hi all,
Currently I'm working on a program with (at this moment) 100 windows.
In the app of the program I have this code - (x 100).
m_pProg001Template = new CMultiDocTemplate(
IDR_MENU,
RUNTIME_CLASS(CDProg001Doc),
RUNTIME_CLASS(CDProg001Frame),
RUNTIME_CLASS(CDProg001View));
AddDocTemplate(m_pProg001Template);
m_pProg002Template = new CMultiDocTemplate(
IDR_MENU,
RUNTIME_CLASS(CDProg002Doc),
RUNTIME_CLASS(CDProg002Frame),
RUNTIME_CLASS(CDProg002View));
AddDocTemplate(m_pProg002Template);
etc, etc..
then ..
OnCommand (ID_MENU_001, OnProg001)
OnCommand (ID_MENU_002, OnProg002)
(x 100) etc, etc..
App::OnProg001() (x 100)
{
m_pProg001Template->OpenDocumentFile(NULL, TRUE);
}
etc, etc ..
This doesn't look good, and gives a lot of code in the app.
I have the feeling that there is a easier way to do this,
maybe with 5 lines of code , but I have no idea how to do this.
Anybody??
Greetings
Rene
|
|
|
|
|
I never criticise another persons code, afteral. Displaying your code is a bit like displaying your underpants, you never really know if there's a skid mark showing.
But, 100 windows in one application?, Lets just say it seemed a good idea at the time and tell the project leader it was only done to test the theory before going on to the release version, ok?
If you still want 100 windows, you could have an array of doctemplates,
CString sClasssName;
for( j=0;j<100;j++)
{
sClassName = ArrayofClassNames[j];
m_pArrayofTemplates[j] = new CMultiDocTemplate( IDR_MENU, RUNTIME_CLASS(sClassName), RUNTIME_CLASS(CDProg002Frame), RUNTIME_CLASS(sClassName)); AddDocTemplate(m_pProg002Template);
}
I'm sure you get the gist (sorry have to rush this my German server has just gone awal).
But, are you sure you need 100 windows? do you actually need 100 ActiveX windows displaying various information (whatever your app is) which you can create/show/hide/ etc as needed.
sh*t sh*t even i can't get in my german server. better go sort it.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
When you create your doc templates, put the pointers into an array:
m_pDocTemplate[0] = new CMultiDocTemplate(
m_pDocTemplate[1] = new CMultiDocTemplate(
m_pDocTemplate[2] = new CMultiDocTemplate(
... etc
Then for you ID_MENU_001..ID_MENU_100 id's you need to map a command range
ON_COMMAND_RANGE(ID_MENU_001, ID_MENU_100, OnNewDocument)
void CYourApp::OnNewDocument(UINT nID)
{
m_pDocTemplate[nID-ID_MENU_001]->OpenDocumentFile(NULL, TRUE) ;
}
This should then open the right document type. Your ID_MENU_001...ID_MENU_100 id's need to be numbered consecutively for this to work.
Roger Allen
Sonork 100.10016
|
|
|
|
|
Can someone please tell me what message I can capture when a MDI child window is moved by clicking on the titlebar and dragging with the mouse.
I have tried WM_MOVE and WM_MOVING and set debug breakpoints and they don't seem to get called when I move the window. It does work for WM_SIZE when I resize.
Thank you,
Confused
|
|
|
|
|
There is an OnActivate method in the MDIChildFrame class.
Try that.
|
|
|
|
|
I want to do some animation like flash type.. Something moving in the device context area. If I use OnDraw there is a lot of flickering. How can I produce smooth animation in my application.
|
|
|
|
|