|
Is there some way to programmatically set a system environment variable? SetEnvironmentVariable() only sets it for the current process... I need to "permanently" set one.
Any ideas?
J
"I am wise enough to therefore not spout my ill informed opinion as if it were remotely related to fact." - Christian Graus
|
|
|
|
|
Arrrr. Nevermind... You just set the values into the registry under HKEY_CURRENT_USER\Environment.
J
"I am wise enough to therefore not spout my ill informed opinion as if it were remotely related to fact." - Christian Graus
|
|
|
|
|
ANyone knows how to change the status bar height? There seems to be no mention of it.
Thanks in advance!!
|
|
|
|
|
Try adjusting your StatusBar height by SetWindowPos or MoveWindow...
// pSB is your Status Bar
CStatusBar* pSB = GetMessageBar();
pSB->SetWindowPos(...)
// OR
pSB->MoveWindow(...);
Mike M
WinInsider.com
|
|
|
|
|
The RGB function takes 8 bits each for Red, Green & Blue - making it a total of 24 bits. So, how does one write a program that would exploit the full 32 bit support of any decent graphics card?
Thanks in advance.
|
|
|
|
|
Your video card will still only support an 8 bit channel for Red Green and Blue, however it can then hold an alpha channel that can be used to hold other data, for transparent, or alpha belnding, for instance.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
GDI doesn't really support the 4th channel (except for a function or two in Win2K and XP). GDI+, does support the alpha channel, though. Take a look at the GDI+ tutorials on this site.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
More advanced color formats would probably require DirectX or OpenGL.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
"32-bit" graphics cards are by and large just 24 bits stuffed into 32 bits. Why? Because it's faster to move 32-bit aligned data than 24-bit aligned data.
If they use the high 8 bits for anything, it's for transparency information, and that's not used on the primary surface anyway, only for textures and blitted surfaces.
I wrote an article on 16-bit and 32-bit graphics for Windows Developers Journal; it's here.
--
Tim
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws
|
|
|
|
|
When you look at 3d programming, you might have 8R,8G,8B,8Z where the Z is the Z-depth of the pixel. This would be the frame buffer.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Greetings:
I have an application using CHTMLView which creates multiple HTML files based on user input. I have a print option but I want to be able to print ALL html files in a directory, not just the currently viewed HTML file. Is there any predefined class / function that will accept an HTML file and print it silently (no dialog box) in the background?
Thanks in advance for any info.
|
|
|
|
|
I have CPropertySheet inside CDialog instead the control with ID - IDC_PROPSHEET_WINDOW.
I have 7 identical CPropertyPage, but with different labels.
The code of realization is given below.
But if tabs are placed more than in one line, there is the mistake of drawing connected by that the top line of tabs is visible only.
Code of realization in OnInitDialog() the following.
m_sheet.AddPage(&m_pageMyPage1);
m_sheet.AddPage(&m_pageMyPage2);
m_sheet.AddPage(&m_pageMyPage3);
m_sheet.AddPage(&m_pageMyPage4);
m_sheet.AddPage(&m_pageMyPage5);
m_sheet.AddPage(&m_pageMyPage6);
m_sheet.AddPage(&m_pageMyPage7);
m_sheet.Create(this, WS_CHILD | WS_VISIBLE);
m_sheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT);
TC_ITEM item;
item.mask = TCIF_TEXT;
TCHAR szText [100];
CString sTitle;
for (int i = 0; i < 7; i++)
{
sTitle.Format(_T("Long label %d"), i);
lstrcpy(szText, sTitle);
item.pszText = szText;
m_sheet.GetTabControl ()->SetItem (i, &item);
}
RECT rect;
HWND hwnd;
GetDlgItem(IDC_PROPSHEET_WINDOW, &hwnd);
ASSERT(hwnd);
if (hwnd)
{
::GetWindowRect(hwnd, &rect);
ScreenToClient(&rect);
m_sheet.SetWindowPos(NULL, rect.left, rect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
}
Most likely a problem that at addition CPropertyPage they have small length of labels and hold in one line.
And when I change label of the tab on the text with greater long tabs occupy more than one line.
Thus control ceases correctly them to display.
One of decisions, by default in label of the template CPropertyPage to place the text of long not less maximal length of the future label, then all is drawn normally.
Whether there are some more decisions of this problem?
Best regards,
Eugene Pustovoyt
Eugene Pustovoyt
|
|
|
|
|
Hi,
I am writing a program, I want it to display datas in the view.When you press a menu item ,the view display some data,and when you press another menu item,
the view was made to empty and display another data.How to do it? It seems CView::invalidate ()does not do the thing well.Can anyone tell me? Thank you.
YES, I am here.
|
|
|
|
|
You have to override OnPaint to control how the data is rendered.
And an FYI: "data" is the plural form. "datum" is singular.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
If it is a FormView, you could add edit or Static controls and then use UpdateData.
OnInitialUpdate is called in the beginning. You would use this to initialize anything. This means updating the initial data on the page.
|
|
|
|
|
Sorry, not CView::OnInitialUpdate(), it is CView::Invalidate (),I made the mistake.I just want empty the view and display ,how to do it?
YES, I am here.
|
|
|
|
|
|
I want to handle an event fired by an Active X which is placed in a HTML file. This event has two parameters.
The problem is that I try to use the DHTML_EVENT_AXCONTROL macro but the handler functions of this macro must be of type
void __stdcall (void) and I need a function that recieves the two parameters.
Please Help Me. Thanks.
Jose Vicente
|
|
|
|
|
Are the handles returned from the following funcs going to be same??
GetModuleHandle(NULL)
GetCurrentProcess(void)
|
|
|
|
|
No they do not return the same thing.
GetModuleHandler returns a handle to the module that you request, which cooincidnetally is the address at which the Module was loaded into memory.
GetCurrentProcess returns a pseudo-handle, which if you use that handle value in any of the functions that expects a process handle, it will be interpreted as the current process.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
|
Hi,
We have a pop3 email server and several accounts. There is one specific account which receives some important .csv files from clients as attachments. I am writing a program which reads these mails and extract the attachment.
For heavens sake, can someone tell me how to do this in c++. You dont have to provide a code, but atleast direct me where I should start.
I used Simple MAPI, but it only reads mails from the profiles created in your machine (or the machine where u install the program).
And my program should not expect any profile created already for that email account. My program should be a command line utility for reading mails that you provide, server name, user name, pwd and other necessary info and hit enter - it should copy all the mail attachments to any folder that either u specify or it is configured somewhere.
[After a week long reading, I am so fed up of reading MAPI materials but nothing gets into my mind - feeling like fish out of water]
Please help me...
omkamal
|
|
|
|
|
No need to use MAPI. See this article for a simple way to access your POP server.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thank you Ravi for the reply. But there is something I need to tell. I tried directly from my cmd box and telnet to my pop3 server. I tried to pull the mails. It worked fine, but it gives me only garbage for the attachments. It also throws an info saying, "Since the mail message is in MIME format your mail reader is unable to translate it and so part or all of the message you may see are not text" - or something like it.
Is there any other way to read and save my attachments (especially with the exact file name that the sender sent)?
Remember, I want this utility to work in a lights-out environment. All the end user should see the next morning is bunch files on a specified folder. He should not care what command line program executes underneath.
omkamal
|
|
|
|
|
omkamal wrote:
Is there any other way to read and save my attachments (especially with the exact file name that the sender sent)?
Yep. See my last reply.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|