Click here to Skip to main content
16,004,977 members
Home / Discussions / C#
   

C#

 
GeneralRe: Terminate C# app at system shutdown Pin
James T. Johnson16-Apr-03 7:12
James T. Johnson16-Apr-03 7:12 
GeneralRe: Terminate C# app at system shutdown Pin
pahlsson16-Apr-03 7:17
pahlsson16-Apr-03 7:17 
GeneralRe: Terminate C# app at system shutdown Pin
pahlsson16-Apr-03 7:21
pahlsson16-Apr-03 7:21 
QuestionDirectory Dialog Box?? Pin
bania15-Apr-03 15:17
bania15-Apr-03 15:17 
AnswerRe: Directory Dialog Box?? Pin
Chris Austin15-Apr-03 18:54
Chris Austin15-Apr-03 18:54 
AnswerRe: Directory Dialog Box?? Pin
chito15-Apr-03 22:09
chito15-Apr-03 22:09 
AnswerRe: Directory Dialog Box?? Pin
Mazdak16-Apr-03 2:59
Mazdak16-Apr-03 2:59 
GeneralChange title bar color (or menu) Pin
mirano15-Apr-03 13:59
mirano15-Apr-03 13:59 
Hi guys,

I want to change title bar color, but I am doing something wrong. So please, if anybody knows what it is, it would be good to let me know.

I declare:
using System.Runtime.InteropServices;

then I import API:
[DllImport("user32.dll")]
public static extern int SetSysColors(int nChanges, int lpSysColor, int lpColorValues);
[DllImport("user32.dll")]
public static extern int GetSysColor(int nIndex);

and then I call it this way:
int iRes = GetSysColor(4);
MessageBox.Show("Result: " + iRes.ToString());

iRes = SetSysColors(0, 4, 14898176);
MessageBox.Show("Result: " + iRes.ToString());

The first message box returns 16777215 which is a color of the menu (number 4 is the constant for menu), so it means GetSysColor function works, but the second function returns 0, which means it failed, and color of the menu does not change.
Why is that? Am I missing something obvious?

Thanks for your answers.

.
GeneralRe: Change title bar color (or menu) Pin
Chris Jobson15-Apr-03 23:06
Chris Jobson15-Apr-03 23:06 
GeneralRe: Change title bar color (or menu) Pin
mirano15-Apr-03 23:34
mirano15-Apr-03 23:34 
GeneralUnreachable Code Detected Pin
vinkoval15-Apr-03 12:43
vinkoval15-Apr-03 12:43 
GeneralRe: Unreachable Code Detected Pin
James T. Johnson15-Apr-03 13:27
James T. Johnson15-Apr-03 13:27 
GeneralRe: Unreachable Code Detected Pin
vinkoval15-Apr-03 18:52
vinkoval15-Apr-03 18:52 
GeneralRe: Unreachable Code Detected Pin
James T. Johnson15-Apr-03 19:01
James T. Johnson15-Apr-03 19:01 
GeneralSystem.Type usage Pin
S O S15-Apr-03 9:34
S O S15-Apr-03 9:34 
GeneralRe: System.Type usage Pin
Andres Manggini15-Apr-03 9:41
Andres Manggini15-Apr-03 9:41 
GeneralRe: System.Type usage Pin
S O S15-Apr-03 9:51
S O S15-Apr-03 9:51 
GeneralRe: System.Type usage Pin
James T. Johnson15-Apr-03 10:12
James T. Johnson15-Apr-03 10:12 
GeneralRe: System.Type usage Pin
leppie15-Apr-03 10:40
leppie15-Apr-03 10:40 
GeneralRe: System.Type usage Pin
James T. Johnson15-Apr-03 10:44
James T. Johnson15-Apr-03 10:44 
GeneralRe: System.Type usage Pin
S O S15-Apr-03 19:39
S O S15-Apr-03 19:39 
GeneralThis is sad Pin
RB@Emphasys15-Apr-03 7:32
RB@Emphasys15-Apr-03 7:32 
GeneralRe: This is sad Pin
Martin Cook15-Apr-03 7:45
professionalMartin Cook15-Apr-03 7:45 
GeneralRe: This is sad Pin
RB@Emphasys15-Apr-03 7:50
RB@Emphasys15-Apr-03 7:50 
QuestionCType in C#? Pin
monrobot1315-Apr-03 7:25
monrobot1315-Apr-03 7:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.