Jump to content
Xtreme .Net Talk

eran

Avatar/Signature
  • Posts

    66
  • Joined

  • Last visited

1 Follower

About eran

  • Birthday 02/06/1972

eran's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. PlausiblyDamp, 10x. i just realized i needed in order to get the value of the "(Default)" key, to set "LPCTSTR pszValueName" parameter to "". this is fine. the new problem is, that the Create method(which creates a new key, is not as straight forward as it seems. i used it as followed: Create(HKEY_CLASSES_ROOT,"*\\shell"); Now i get lots of compilation error. I searched the internet and saw that the implimintation of this api should be as followed: Create(HKEY_CLASSES_ROOT,"CLSID\\{6270AEE4-AA41-11d4-A25D-008048B63F94}"); Now what is this I asked? Microsoft, in their help didn't talk about that. now i need to use the SetGUIDValue method. so... what the h... is going on here? i just wanted to create new key for "HKEY_CLASSES_ROOT\*" which should be look like "HKEY_CLASSES_ROOT\*\shell" If you have any idae, please help.
  2. Hi, I am trying to use the APIs to read write to the registry: QueryBinaryValue and SetBinaryValue to the first value in each key. meaning. lets asume i have the following path in my registry HKEY_CLASSES_ROOT\*\shel\\Get Path\command in Command i have the first key (Default). i want to Query and se valuse. in some reason i don't succeed to. i use the open function. itreturn success. but the Query and set binary fails... 10x,
  3. 10x...man. can i retrieve info on a file using the menu? does the menu can give me the path of the object i just right clicked on?
  4. Hi, I want to write a small app in which i can tell the path and a file name. I want to do it as: 1. add to the mouse menu command 'get file path' string. I want, this command, to be added as a permanent command to the mouse menu, unless, i uninstall the app. meaning, like when you install winzip, it adds to the mouse menu 3 commands, etc'... 2. by clicking this command, the file info file path and name will be insert to the clip board and then just simply pasting it. So, if you can help me in, creating new mouse command and then retriving a file location+name i'dd be grate full. 10x.
  5. eran

    creating editor

    PlausiblyDamp, thank you, my man.
  6. Hi, I need to create a very simple editor. it is not for .NET or any other known language. actually, it is for my company. So, I am looking mostly for algorithm helping/implementing tips... Mostly on how to make the editor recognising words, painting them, etc'... any help would be thankfull.
  7. Hi, all. Just woundering, why did Microsoft made it hard(or unavailable) to "talk" to modems using C#?
  8. OK, I managed to hide the dialog form at start up. I put the main function in other class then the form init class. the problem is that the app terminate. I want to use icon in the tray-icon. is there a way to do that without causing the app to terminate?
  9. aewarnick, There is no need to mess things up. just do the following changes: public const int DM_DISPLAYFREQUENCY = 0x400000; . . . dm.dmDisplayFrequency=85; dm.dmFields = DEVMODE.DM_PELSWIDTH | DEVMODE.DM_PELSHEIGHT | DEVMODE.DM_DISPLAYFREQUENCY;
  10. IT WORKS. Only left to add the Frequency. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Runtime.InteropServices; namespace ScreenResolution { public class Form1 : System.Windows.Forms.Form { public enum DMDO { DEFAULT = 0, D90 = 1, D180 = 2, D270 = 3 } [structLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)] struct DEVMODE { public const int DM_PELSWIDTH = 0x80000; public const int DM_PELSHEIGHT = 0x100000; private const int CCHDEVICENAME = 32; private const int CCHFORMNAME = 32; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=CCHDEVICENAME)] public string dmDeviceName; public short dmSpecVersion; public short dmDriverVersion; public short dmSize; public short dmDriverExtra; public int dmFields; public int dmPositionX; public int dmPositionY; public DMDO dmDisplayOrientation; public int dmDisplayFixedOutput; public short dmColor; public short dmDuplex; public short dmYResolution; public short dmTTOption; public short dmCollate; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=CCHFORMNAME)] public string dmFormName; public short dmLogPixels; public int dmBitsPerPel; public int dmPelsWidth; public int dmPelsHeight; public int dmDisplayFlags; public int dmDisplayFrequency; public int dmICMMethod; public int dmICMIntent; public int dmMediaType; public int dmDitherType; public int dmReserved1; public int dmReserved2; public int dmPanningWidth; public int dmPanningHeight; } //--------------------------------\ [DllImport("user32.dll", CharSet=CharSet.Auto)] //static extern int ChangeDisplaySettings( DEVMODE lpDevMode, int dwFlags); // should I use this line? static extern int ChangeDisplaySettings( [in] ref DEVMODE lpDevMode, int dwFlags); /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.Size = new System.Drawing.Size(300,300); this.Text = "Form1"; } #endregion static void Main() { Form1 r = new Form1(); r.ChangeRes(); Application.Run(new Form1()); } void ChangeRes() { Form1 t = new Form1(); long RetVal=0; DEVMODE dm = new DEVMODE(); dm.dmSize= (short)Marshal.SizeOf(typeof(DEVMODE)); dm.dmPelsWidth = 1024; dm.dmPelsHeight= 768; dm.dmFields = DEVMODE.DM_PELSWIDTH | DEVMODE.DM_PELSHEIGHT; RetVal = ChangeDisplaySettings(ref dm, 0); } } }
  11. It doesn't work for Win2k as well.
  12. try to switch between the width and the flags values? could it be a bug in the OS,C# or the API? after all, we might be the first who try to use this api for XP using C#! BTW, where did you find the values for the fields?
  13. still, doesn't work. even when I use the following changes: static extern int ChangeDisplaySettings( [in] ref DEVMODE lpDevMode, int dwFlags); . . . DEVMODE dm = new DEVMODE(); long RetVal=0; const int DM_PELSWIDTH = 0x80000; const int DM_PELSHEIGHT = 0x100000; dm.dmPelsWidth = 600; dm.dmPelsHeight= 800; dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; RetVal = ChangeDisplaySettings(ref dm, 0); Still, return 0 and doesn't make the shanges...
  14. there is one more commands which need to be added: The reason that it doesn't change is because we need to set the "dm.dmFields" using the "DM_PELSWIDTH , DM_PELSHEIGHT" struct members I don't know how to make this in C#. this is a VB code Const DM_PELSWIDTH = &H80000 Const DM_PELSHEIGHT = &H100000 The above commands don't pass the compiler. and then dm.dmPelsWidth = 600; dm.dmPelsHeight= 800; dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT ChangeDisplaySettings(dm, 0);
  15. Divil, I wrote some code. but in some reason, it doesn't make the effect. I added here the code. I'll Appreciate, if you'll take a look. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Runtime.InteropServices; namespace ScreenResolution { public class Form1 : System.Windows.Forms.Form { public enum DMDO { DEFAULT = 0, D90 = 1, D180 = 2, D270 = 3 } [structLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)] struct DEVMODE { private const int CCHDEVICENAME = 32; private const int CCHFORMNAME = 32; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=CCHDEVICENAME)] public string dmDeviceName; public short dmSpecVersion; public short dmDriverVersion; public short dmSize; public short dmDriverExtra; public int dmFields; public int dmPositionX; public int dmPositionY; public DMDO dmDisplayOrientation; public int dmDisplayFixedOutput; public short dmColor; public short dmDuplex; public short dmYResolution; public short dmTTOption; public short dmCollate; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=CCHFORMNAME)] public string dmFormName; public short dmLogPixels; public int dmBitsPerPel; public int dmPelsWidth; public int dmPelsHeight; public int dmDisplayFlags; public int dmDisplayFrequency; public int dmICMMethod; public int dmICMIntent; public int dmMediaType; public int dmDitherType; public int dmReserved1; public int dmReserved2; public int dmPanningWidth; public int dmPanningHeight; } //--------------------------------\ [DllImport("user32.dll", CharSet=CharSet.Auto)] static extern int ChangeDisplaySettings( DEVMODE lpDevMode, int dwFlags); // should I use this line? //static extern int ChangeDisplaySettings( [in] ref DEVMODE lpDevMode, int dwFlags); /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.Size = new System.Drawing.Size(300,300); this.Text = "Form1"; } #endregion static void Main() { Form1 r = new Form1(); r.ChangeRes(); Application.Run(new Form1()); } void ChangeRes() { long RetVal=0; DEVMODE dm = new DEVMODE(); dm.dmPelsWidth = 600; dm.dmPelsHeight= 800; dm.dmFields = dm.dmPelsWidth | dm.dmPelsHeight; RetVal = ChangeDisplaySettings(dm, 0); } } }
×
×
  • Create New...