|
Hello All,
I want to delete "Games" from windows 7. i.e. delete all the installation files from the system, so that if in case user turns the Game feature ON, OS should ask for some media like DVD to copy those installation files.
Turn the Feature OFF & ON does not achieve my target. i have to remove files to make more space available.
NOTE: By default windows 7 contains all the files within its local storage ie HDD
Any suggestion how to approach the problem.
Thanks!
modified on Thursday, September 23, 2010 5:26 AM
|
|
|
|
|
With C/C++ ? or is this a general question ?
Watched code never compiles.
|
|
|
|
|
it is general discussion. or if there is any API or any way in C, i can go for that too.
|
|
|
|
|
I have create a SDI application with Doc/View architecture. I have attached a view while creating mainframe (code below).
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(COptiumDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CMyView));
I want to access function created in CMyView from the Mainframe.
How can I do that?
|
|
|
|
|
CMyView* pView = (CMyView*)GetActiveView()
for further problem to have pointer access look here ^
modified on Friday, September 24, 2010 1:14 AM
|
|
|
|
|
hi
I want to draw a perpendicular line from another line.How can it be implemented in VC++(GDI).
thanks
|
|
|
|
|
Have you looked at MoveTo() , LineTo() , et al?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Use analytic geometry this is easy to solve. A line can be defined by two points. You want another line that passes through a point and form a right angle with the first line.
After you find the second line use GDI functions MoveTo() and LineTo() to draw the second line.
|
|
|
|
|
Hi,
I have created a CListControl, I want to draw grey border color around it so I write the below code to draw border but all string are not visible.
How to do that?
void CListCtrl::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect(rect);
CPen pen(PS_SOLID,1,RGB(211,211,211));
CBrush* pOldBrush = (CBrush*)dc.SelectStockObject( NULL_BRUSH );
dc.SelectObject(&pen);
dc.Rectangle(&rect);
pOldBrush->DeleteObject();
pen.DeleteObject();
}
|
|
|
|
|
You need to override the OnNcPaint, not the OnPaint.
And don't forget to call "Default();" to draw the interior
for example (done for a listbox derived class, but you should be able to see how it workd...
void MyListBox::OnNcPaint()
{
// draw the inside.
Default();
// draw over the border.
CRect rc;
GetWindowRect(rc);
CDC *pDC = GetParent()->GetDC();
GetParent()->ScreenToClient( rc );
// do the drawing ...
pDC->FrameRect( rc , brush );
rc.DeflateRect( 1, 1, 1, 1 );
pDC->FrameRect( rc,brush );
}
Watched code never compiles.
|
|
|
|
|
Thanks for you reply.
I replied (code below) but getting any border around the window
void CTxListCtrl::OnNcPaint()
{
Default();
CRect rc;
GetWindowRect(rc);
CDC *pDC = GetParent()->GetDC();
GetParent()->ScreenToClient( rc );
CBrush brush(RGB(255,0,0));
CPen pen(PS_SOLID,1,RGB(211,211,211));
pDC->SelectObject(&pen);
pDC->Rectangle(&rc);
pDC->FrameRect( rc , &brush );
rc.DeflateRect( 1, 1, 1, 1 );
pDC->FrameRect( rc,&brush );
}
|
|
|
|
|
Why not set a style that creates a client edge around your CListCtrl:
BEGIN_MESSAGE_MAP(CMyListCtrl, CListCtrl)
ON_WM_CREATE()
END_MESSAGE_MAP()
void CMyListCtrl::OnCreateStyles()
{
ModifyStyle(WS_BORDER, 0);
ModifyStyleEx(WS_EX_STATICEDGE, WS_EX_CLIENTEDGE);
}
void CMyListCtrl::PreSubclassWindow()
{
CListCtrl::PreSubclassWindow();
OnCreateStyles();
}
int CMyListCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListCtrl::OnCreate(lpCreateStruct) == -1)
return -1;
OnCreateStyles();
return 0;
}
|
|
|
|
|
This is adding HSCROLL and VSCROLL also. I dont need scroll bar.
Plz give a light on this issue.
|
|
|
|
|
Hi, I wrote two C++ Windows applications which I previously used on WinXP.
The main MFC application gets no UAC prompt when I start it, works fine on Win7.
The Win32 application, which is just a WinMain() with some functionality, gets an UAC prompt as soon as I double click it. Can I find out why?
Thanks, let me know if I should provide more details!
|
|
|
|
|
What does the check box "Run as administrator" show
(in the "Compatibility" property page of the result exe), please ?
Here is an example of "any-user" manifest,
that could be bind to an exe:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
virtual void BeHappy() = 0;
|
|
|
|
|
"Run as administrator" is not enabled.
Can you give me some background on the manifest? Does every executable need one under Win7 in order to avoid UAC prompt... or is it some API call inside my exe which causes the UAC prompt?
|
|
|
|
|
// or is it some API call inside my exe which causes the UAC prompt?
May be...
...when it (test) will not help :
- save the XML-dump as c:\yours.manifest
- set the exe-VS\ProjektProperty\Manifest Tool\Input and Output\Additional Manifest Files to c:\yours.manifest
- rebuild
An "admin" API call would just fail, I think,
by filled LastError (about some rights) in the "non-admin" modus...
virtual void BeHappy() = 0;
|
|
|
|
|
|
It could simply be the name of your exe file also. Vista (and Windows 7) UAC also uses heuristics to determine if an application needs admin privilege.
See this article[^] on MSDN (especially the "Installer Detection" part). Even strings in the string table of your application can trigger UAC.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
krmed wrote: UAC also uses heuristics to determine if an application needs admin privilege.
Yes that's it! The file is a software_updater.exe , the text "update" in file name or version info triggers the "installer detection". Now have to find a way around that, I am curious if I can do the following: 1) keep file name without UAC prompt, 2) elevate privileges on runtime when actually needed. Most time my software updater justs needs to run with normal user rights, only when the main application is updated it would need more privileges.
Btw, if someone is interested, I would have never mentioned the problem if my MSI installer wouldn't have failed. You can't run (non-deferred) custom actions which will then trigger a UAC prompt, they fail silently.
Thanks for the info!
|
|
|
|
|
I have created a new menu in my MDI application,and the menu can be displayed.
However,the window menu can not be properly displayer.
there is no any window name in the popup menu of window menu.
the window menu is on the left of the help menu.
I know the OnCreateClient will get the menu handle,but I dont know why it cannot display properly.
thanks in advance for any kind of help.
Bill
modified on Thursday, September 23, 2010 3:38 AM
|
|
|
|
|
Do not cross-post the same question to multiple forums (you have posted this question to the QA too). The best is to post a question only once in the more appropriated forum.
|
|
|
|
|
you should modify IDR_application menu in resource view.
|
|
|
|
|
First of all,thanks for your help.
I have resolved this problem.
The reason of this problem is that the function GetWindowMenuPopup is not properly implemented.
The MFC frame make use of this function to add window name to the window menu which is on the left of the help menu.
The default GetWindowMenuPopup function look up window menu handle only by the resource ID.If the resource ID of the menu is between AFX_IDM_WINDOW_FIRST and AFX_IDM_WINDOW_LAST,the frame consider it as a window menu.
So when I create a new menu,it's ID is not between the range and the frame doesnot add window name to the window menu.
Now I have overrided the GetWindowMenuPopup in my derived class,it is as below:
HMENU CHotelFrameWnd::GetWindowMenuPopup(HMENU hMenuBar)
{
if (hMenuBar == NULL)
return NULL;
ASSERT(::IsMenu(hMenuBar));
int iItem = ::GetMenuItemCount(hMenuBar);
while (iItem--)
{
HMENU hMenuPop = ::GetSubMenu(hMenuBar, iItem);
if(hMenuPop != NULL)
{
MENUITEMINFO mii;
TCHAR szBuf[256];
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
mii.fType = MFT_STRING;
mii.dwTypeData = szBuf;
mii.cch = sizeof(szBuf);
mii.fState = MFS_ENABLED;
::GetMenuItemInfo(hMenuBar,iItem,TRUE,&mii);
if(strcmp(szBuf,_T("窗口(&W)")) == 0)
{
return hMenuPop;
}
}
}
// no default menu found
TRACE(traceAppMsg, 0, "Warning: GetWindowMenuPopup failed!\n");
return NULL;
}
WeatherYoung
|
|
|
|
|
Hi,
I am getting getting time through CTime::GetCurrentTime() but I am getting time in 24 hours format.
How can I change it in 12 hours format?
|
|
|
|