473,609 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to create a new window after pressing a buttom in a diglog??

Hi all,

I am trying to create a new window (without border, title bar..etc) for
using brush to make the whole screen become red.

So, anyone knows how to create a new window after pressing a buttom in a
diglog??

Thanks,
Jun 27 '08 #1
2 1197
"Kelvin" <Ke****@discuss ions.microsoft. comwrote in message
news:87******** *************** ***********@mic rosoft.com...
Hi all,

I am trying to create a new window (without border, title bar..etc) for
using brush to make the whole screen become red.

So, anyone knows how to create a new window after pressing a buttom in a
diglog??

Thanks,

I don't know if this helps, but here's a copy of my reply to your previous
thread:
"Kelvin" <Ke****@discuss ions.microsoft. comwrote in message
news:82******** *************** ***********@mic rosoft.com...
Hi Marks,

Thanks a lot. I can use the code to display red color on the entire
screen.

But, how to create a window, make the size of the screen and retrieves the
device context (DC) for that window?


Hi Tim,

Sorry for the delayed reply. I was out of town all last week.

If you still need an example of creating a full screen colored window,
here's some code...

//-----------------------------------------------------
// FullScreenColor Wnd.h
//-----------------------------------------------------

#pragma once
#include "afxwin.h"
// CFullScreenColo rWnd

class CFullScreenColo rWnd : public CFrameWnd
{
DECLARE_DYNAMIC (CFullScreenCol orWnd)

public:
CFullScreenColo rWnd();
virtual ~CFullScreenCol orWnd();

protected:
DECLARE_MESSAGE _MAP()
virtual BOOL PreCreateWindow (CREATESTRUCT& cs);
public:
afx_msg int OnCreate(LPCREA TESTRUCT lpCreateStruct) ;
afx_msg BOOL OnEraseBkgnd(CD C* pDC);
afx_msg void OnLButtonDown(U INT nFlags, CPoint point);

CBrush m_BkgndBrush;
};

//-----------------------------------------------------
// FullScreenColor Wnd.cpp
//-----------------------------------------------------

#include "stdafx.h"
#include "FullScreenColo rWnd.h"
// CFullScreenColo rWnd

IMPLEMENT_DYNAM IC(CFullScreenC olorWnd, CFrameWnd)

CFullScreenColo rWnd::CFullScre enColorWnd()
{
m_BkgndBrush.Cr eateSolidBrush( RGB(0xFF,0x00,0 x00));
}

CFullScreenColo rWnd::~CFullScr eenColorWnd()
{
}
BEGIN_MESSAGE_M AP(CFullScreenC olorWnd, CFrameWnd)
ON_WM_ERASEBKGN D()
ON_WM_LBUTTONDO WN()
ON_WM_CREATE()
END_MESSAGE_MAP ()

// CFullScreenColo rWnd message handlers

BOOL CFullScreenColo rWnd::PreCreate Window(CREATEST RUCT& cs)
{
BOOL ret = CFrameWnd::PreC reateWindow(cs) ;

cs.style = WS_VISIBLE | WS_POPUP;
cs.dwExStyle = 0;

return ret;
}

int CFullScreenColo rWnd::OnCreate( LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnC reate(lpCreateS truct) == -1)
return -1;

HDC ScreenDC = ::GetDC(NULL);
MoveWindow(0, 0, ::GetDeviceCaps (ScreenDC, HORZRES),
::GetDeviceCaps (ScreenDC, VERTRES));
::ReleaseDC(NUL L, ScreenDC);

return 0;
}

BOOL CFullScreenColo rWnd::OnEraseBk gnd(CDC* pDC)
{
CRect CliRect;
GetClientRect(& CliRect);
pDC->FillRect(&CliR ect, &m_BkgndBrus h);

return TRUE;
}

void CFullScreenColo rWnd::OnLButton Down(UINT nFlags, CPoint point)
{
DestroyWindow() ;
}

//-----------------------------------------------------
// Example creating the window - click on the window to destroy it
//-----------------------------------------------------

CFullScreenColo rWnd *pFullScreenCol orWnd = new CFullScreenColo rWnd();
pFullScreenColo rWnd->Create(NULL, _T(""));


Mark

--
Mark Salsbery
Microsoft MVP - Visual C++

Thanks,
Tim



Jun 27 '08 #2
cal
do u use c,cpp, or mfc?, Carlos

"Kelvin" <Ke****@discuss ions.microsoft. comwrote in message
news:87******** *************** ***********@mic rosoft.com...
Hi all,

I am trying to create a new window (without border, title bar..etc) for
using brush to make the whole screen become red.

So, anyone knows how to create a new window after pressing a buttom in a
diglog??

Thanks,

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1455
by: Nick | last post by:
I have a image buttom to close the popup window. Any easy way to make the image buttom to sink at the bottom of the window? And the buttom should flow with the text/table if the text flow is longer then popup window....
5
10870
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code works fine if I click to open in > the same window, but if I click the browser option to open in a > new window, the new window tries to open the href URL (the > onClick function does get executed, but seems to be ignored). > ...
1
2383
by: Michael Reiche | last post by:
Trying to create a database - right click -> Create Database Wizard on the db instance - before I enter the username/password, the Create Database Wizard takes off doing *something* - the Progress pop-up showing Elapsed Time sits there for ten minutes or more before telling me the username/password is incorrect (of course it's incorrect, I haven't entered it yet). Anyone seen this before?
2
1258
by: Patrick | last post by:
I remeber seeing a sample on th e.net (and in fact i tried this too - but lost the source code), to achieve the following. Dropping a control onto a form, which is exactly like the properties window, and can be used to set the properties of a control, esp command buttom. Anyone out there know how this is done, I just can't remeber and its eating me. tks
1
2167
by: Daniel | last post by:
Hi, I learn visual c++, and I have made an example with the IDE environnement,( MFC exe). I add a buttom and I want when the buttom is clicked, open an other formview that I created in my projet, Insert FromView. I do not know how make, can you help me ? Thank Daniel
8
20351
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1: Start with original thumbnails & two empty sub directories STEP 2: Create smaller versions of the originals for one sub directory STEP 3: Create thumbnail version of the originals the other sub directory STEP 4: Create an index.html pointing to the...
14
1654
by: techbuddha | last post by:
Hey everyone many thanks for help with my last post. This one I hope is an easy one for folks here I am opened a record set and at the begining of the do loop to begin iterating through the set the EOF value is already "true" so all my code is skipped. I check the local window and tested the sql statement in access by creating a blank query and pasting the sql into the query and running it. It works fine this is the sql statment being...
5
2382
by: sbettadpur | last post by:
Hi, Please help me, Here i have a problem When i am trying to close the main browser i need to popup a confirmation window actually i had a code that is working on IE browser with some issues Here is my code <html> <head>
0
857
by: olanger | last post by:
Let me explain the scenerio, I have a window service that has timer and OnElapsed timer event I'm calling a method. This method process business logic and It's multi threaded. The problem...when the window service starts and you try to stop it by going to the window service and pressing stop, It won't. I'm getting a message "the service didn't respond in timely matter". When debuging the window service and pressing service stop the onStop event...
0
8139
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8091
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8555
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8232
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8408
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6064
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4032
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.