Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Natural_Demon

@Natural_Demon
About
Posts
61
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Create a custom Setup tool to instal other setup programs. (hooking involved.)
    N Natural_Demon

    hi i would to create a tools to make life easy. i would like to join a few basic setup file on fresh installed pc's. but i only wanna do a few click and not look @ the screen @ the each of each individual setup file. i would program the order how to execute, open the setup file from known feeware /media software / ccleaner / etc, and programaticly click the button of the setup file. there use to be a very known free anti spam / add program from the netherlands with did this. it's easy to check the open processes for names. but what to do next, if you have the handle of the setup file windows? how do i make the very wel known 'next' button go click? i have pretty wide knowlegde of visual c#, i have done some Nokia Qt c++, made a custom control draw control in like 2 days or so. but not to much ms vc++, accept some mfc years ago. the idea is, the app has to run on 1 minute old fresh windows installation. so i would like to try it in c++. how to scan all the processes running by 'username' in proceslist? to get handle of the window, to find handle of the wanted button, checkboxes? another posibility is to make the mouse move and click, since you know the the setup windows location. set Focus, you probably can send a winproc message to the operation system and make it click. read updates from progres bars, panel change. could anyone help me solf this problem, ith any usefull info. thank you

    Bad = knowing 2 much

    C / C++ / MFC c++ help question csharp tools

  • how hook the registry
    N Natural_Demon

    wel the program is for my customers. the computers i sell and install, debug & fix for my clients in my friends lilte store. so i have 'admin' acces from first moment on. yes, i wanna intercept any program a user executes and attempts to write to the registry. but much investigation has to be done. because some proceses execute as 'system' and not as user. but in the first place, i only want to protect certains spots in the registry, you know the dangerous spots, run, runonce, etc, etc. the 'hook' is targetted @ people that have no clue and just chat, navigate a litle.

    Bad = knowing 2 much

    C / C++ / MFC windows-admin tutorial question

  • how hook the registry
    N Natural_Demon

    hmmmm, this is 'API hooking revealed[^]' instresting material. it provide something i need. hook all proceses. atleast the test app's log told me exactly what programm i have open. : )

    Bad = knowing 2 much

    C / C++ / MFC windows-admin tutorial question

  • how hook the registry
    N Natural_Demon

    wel, i don't know at all , but i wanna write sometol, to inform my customers that there is something wrong. i probably need to hook in the kernel or so. i read some of the links from msdn and codeproject, but stil nothing what i need, but good info. : )

    Bad = knowing 2 much

    C / C++ / MFC windows-admin tutorial question

  • how hook the registry
    N Natural_Demon

    yes, that's what i wanna do, hook a dll into 'windows' or explorer.exe. just like sopme virusses, accept i wanna prevent them.

    Bad = knowing 2 much

    C / C++ / MFC windows-admin tutorial question

  • how hook the registry
    N Natural_Demon

    hello, i would like to write a small service that checks programs that write to registry. does anyone have hints on this subjects? i just wanna detect it. detectif an aplication write/read fro the registry. and if needed prevent from writing to the registry. how to achieve this.

    Bad = knowing 2 much

    C / C++ / MFC windows-admin tutorial question

  • How to make line hover when hovering with mouse in Richtext control
    N Natural_Demon

    i would like to know how to add a mousehovr effec to lines in the richtext control

    Bad = knowing 2 much

    C# tutorial

  • Checkbox on the ColumnHeader [modified]
    N Natural_Demon

    this is the entire code to create a listview with a checkbox in the left upper corner of the ListView. NM_CUSTOMDRAW seams to be the message when the mouse hover over the headers. but i fail to keep the checkBox visible / ontop @ all time. if you slightly hoover of the first header, the headers mousehover effect draws over the check. anyone an idea how to prevent this?

    using System;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    namespace Listview_Colum_header_checkbox
    {
    class CCehckBox2 : CheckBox
    {
    public CCehckBox2()
    {
    Width = 14;
    Height = 14;
    }
    }

    class CustomChechBox2 : Control
    {
        readonly CCehckBox2 \_chb = new CCehckBox2();
        public CustomChechBox2()
        {
            Size = new Size(16, 16);
            \_chb.Location = new Point(0, 0);
            Controls.Add(\_chb);
        }
    }
    
    class CListview2 : ListView
    {
        public delegate void MessageNeedsSendingCallback(string message, Color color);
        public event MessageNeedsSendingCallback OnMessageNeedsSending;
    
    
        //private readonly CCehckBox \_cCehckBox = new CCehckBox();
        private readonly CustomChechBox2 \_cCehckBox = new CustomChechBox2();
    
        private readonly ColumnHeader \_header1, \_header2, \_header3 = new ColumnHeader();
        #region  PInvoke Declarations
    
        \[DllImport("User32", CallingConvention = CallingConvention.Cdecl)\]
        private static extern uint RealGetWindowClass(IntPtr hwnd, System.Text.StringBuilder pszType, int cchType);
    
        \[DllImport("user32")\]
        private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
    
        \[DllImport("user32.dll")\]
        private static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
    
        #endregion
    
        public CListview2()
        {
            View = View.Details;
            //this.HeaderStyle = ColumnHeaderStyle.Nonclickable;
            //\_header1.
            \_header1 = Columns.Add("");
            \_header1.Width = (Location.X + 5) + 12;
            //\_header1.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
            \_header1.Name = "CheckBox";
            \_header1.DisplayIndex = 0;
    
            \_header2 = Columns.Add("bah");
            \_header2.Width = 50;
    
            \_header3 = Columns.Add("boh");
            \_header3.Width = 50;
    
            var wijd = \_cCehck
    
    C#

  • Rotate Text OpenGL
    N Natural_Demon

    bespoke in-house systems = cheap. 'quickly' develop powerful application = cheap. you boss or what ever pays less, becaue it takes less, right? so you do agree with me, be it in other words. regarding 'lazy' didn't count for all readers.

    Bad = knowing 2 much

    C# tutorial csharp c++ graphics game-dev

  • Rotate Text OpenGL
    N Natural_Demon

    there aint much too c++. the synthax is pretty simular, but you have to take care of cleaning recources used yourself. in c# you have the garbage handler, in c++ you don't. in c++ you would have to make a dispose methode pretty much everywhere and it looks very very simular too c# that's what makes c# the competitor of java. cheap develpment software. cheap ... because it needs less time and less acuracy to create something. you don't have to take care of freeing up recources that aren't used anymore, so you never really know if you software is actually 100%, because you don't need to think about it. if it wasn't for the 3rd party dll i use to connect to a virtual world. i wouldn't be using c# at all. translating this 3rd party dll into c++, would take me a year or so. but the downfall of DOTNET is ... you can easy reverse engineer your aplication and resell or hack it. with a simple click in a tool from the internet, you pretty much get the entire code. if you read about dotnet, you would have read the each executable actually transports the entire source and recompiles on the user machie. this is done by the JIT compiler. dotnet wil never be the tool by excellence for software venders. dotnet is used by people that didn't like the looks or feel of java, but also aren't competent or too lazy for c++. i don't live from coding, but this is what i learned in the last years. if my current project is done, i'm going Nokia Qt. power @ finger tips

    Bad = knowing 2 much

    C# tutorial csharp c++ graphics game-dev

  • Checkbox on the ColumnHeader [modified]
    N Natural_Demon

    i extented ...

        \[StructLayout(LayoutKind.Sequential)\]
        private struct NMHDR
        {
            public IntPtr hwndFrom;
            public int idFrom;
            public int code;
        } //NMHDR
    

    to ...

        \[StructLayout(LayoutKind.Sequential)\]
        private struct NMHDR2
        {
            public IntPtr hwndFrom;
            public int idFrom;
            public int code;
            public int coder;
        } //NMHDR
    

    this new variable 'coder' contains numbers, like: -12, -16, -23 -320, -321, -326 -327, -530 -12 and -530 seam to be mouseover and mouseleave. -16 and -326 seam to be mouseclick / down and mouse release. i posted a logoutput. http://pastebin.com/HuCk5cac[^] anyone experienced with this?

    Bad = knowing 2 much

    modified on Tuesday, April 27, 2010 2:47 PM

    C#

  • Checkbox on the ColumnHeader [modified]
    N Natural_Demon

    i would like to achieve a checkbox on a ColumnHeader in a listview. i have been trying for days. i have achieved a checkbox on the right spot in the listview by virtual placing it on top. [DllImport("user32")] private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); protected override void OnHandleCreated(EventArgs e) { SetParent(_cCehckBox.Handle, Handle); base.OnHandleCreated(e); } but the visual style/effect of the header causes the checkbox to fall in the background if you hover the mouse of the header. the Header class doesn't provide anu usefull stuff, atleast i don't see any usefull stuff. i have bene reading alot about it and viewed many things regarding headers. i have also been using ... protected override void WndProc(ref Message message) { .... } filtering on WM_NOTIFY for 'HDN_ITEMCHANGINGA', 'HDN_ITEMCHANGEDA', 'HDN_BEGINTRACKA', 'HDN_BEGINTRACKW'. i used a piece of code from a project here on codeproject, virtually unchanged. but i only get the windows handle, the other things are empty.

        \[StructLayout(LayoutKind.Sequential)\]
        private struct NMHDR
        {
            public IntPtr hwndFrom;
            public int idFrom;
            public int code;
        } //NMHDR
    
    
        //OnMessageNeedsSending(message.ToString(), Color.Black);
            // pass messages on to the base control for processing
    
            base.WndProc(ref message);
            \*/
            const int WM\_NOTIFY = 0x004E;
            const int HDN\_FIRST = (0 - 300);
            const int HDN\_BEGINTRACKA = (HDN\_FIRST - 6);
            const int HDN\_BEGINTRACKW = (HDN\_FIRST - 26);
            bool callBase = true;
    
            switch (message.Msg)
            {
                case WM\_NOTIFY:
                    
                    NMHDR nmhdr = (NMHDR)message.GetLParam(typeof(NMHDR));
                    OnMessageNeedsSending("WM\_NOTIFY " + message, Color.Black);
                    OnMessageNeedsSending("code: " + nmhdr.code + ", hwndFrom: " + nmhdr.hwndFrom + ", idFrom: " + nmhdr.idFrom, Color.Black);
                    switch (nmhdr.code)
                    {
                        case HDN\_BEGINTRACKA:  //Process both ANSI and
                            OnMessageNeedsSending("HDN\_BEGINTRACKA " + message, Color.Black);
                            break;
                        case HDN\_BEGINTRACKW:
    
    C#

  • Rotate Text OpenGL
    N Natural_Demon

    why don't just use c++. you can included a c++ dll. but you also could download Nokia Qt C++. http://qt.nokia.com[^] download the creator + sdk bundle. there are many working opengl examples + code included. very very impressive examples. c++ is a faster than c# and THE choice for directX and OPENGL. there is also the TAO dll for c#, but it looks abandoned. c# is mainly for cheap office develpment, go c++ if you want speed. Nokia Qt rocks even better for office develpment, every control is opensource, it's easier to hook special needs. Qt includes a TimeLine class for special effects. Qt wil rule in the future. check for Kinetic scrolling tutorial. google earth is made with Qt and many other, like Adobe use Qt

    Bad = knowing 2 much

    modified on Tuesday, April 27, 2010 10:36 AM

    C# tutorial csharp c++ graphics game-dev

  • Checkbox on the header of a Listview
    N Natural_Demon

    i tried that, but it doesn't look 'ColumnHeader' it provides me the nessesary properties to do this.

    Bad = knowing 2 much

    C# graphics help tutorial

  • Checkbox on the header of a Listview
    N Natural_Demon

    i have made this piece of code, to a checkbox on the header: wel not realy on the headr, but situated there. (class ColumnHeader doesn't provide much, like for example: OnpaintEvent. but i need some help with the special effects. if you hoover the mouse over the header, the mousehover effect of the header hides the checkbox, bringing it to the background. i would like to have the checkbox ontop @ all time. using windows 7.

    using System;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    
    namespace Listview_Colum_header_checkbox
    {
        class CCehckBox : CheckBox
        {
            public CCehckBox()
            {
                Width = 14;
                Height = 14;
                //a
                //ValidationConstraints.Visible
                //AutoValidate.EnablePreventFocusChange;
            }
    
            protected override void OnPaint(PaintEventArgs pevent)
            {
                Invalidate();
                base.OnPaint(pevent);
            }
        }
    
        class CListViewHeader : ColumnHeader
        {
            void CListViewHeader()
            {
            }
        }
    
        class CListview : ListView
        {
            private readonly CCehckBox _cCehckBox = new CCehckBox();
            private readonly ColumnHeader _header1 = new ColumnHeader();
            private readonly ColumnHeader _header2 = new ColumnHeader();
            private readonly ColumnHeader _header3 = new ColumnHeader();
    
            #region  PInvoke Declarations
    
            [DllImport("user32")]
            private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
    
            #endregion
    
            public CListview()
            {
                View = View.Details;
    
                _header1 = Columns.Add("Name");
                _header1.Width = (Location.X + 5) + 6;
                _header1.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
                _header1.Name = "CheckBox";
                _header1.DisplayIndex = 0;
    
                _header2 = Columns.Add("bah");
                _header2.Width = (Width - 20) - 50;
    
                _header3 = Columns.Add("boh");
                _header3.Width = 50;
    
                var wijd = _cCehckBox.Width;
                var hoog = _cCehckBox.Height;
                _cCehckBox.Location = new Point(Location.X+ 5, Location.Y + 5);
            }
    
    
            protected override void OnColumnWidthChanged(ColumnWidthChangedEventArgs e)
            {
                
                if(e.ColumnIndex == 0)
                {
                    //MessageBox.Show(e.ColumnIndex.ToString());
    
    C# graphics help tutorial

  • how to add costum control to custom control via designer. [modified]
    N Natural_Demon

    hi, yes thank you [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)] class cToolStripMenuItem : ToolStripMenuItem { } how ever, somehow it failed : ( http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/bbad3255-17f5-4177-b7cf-cad20c858746[^] http://books.google.nl/books?id=zDi4LIDvd4wC&pg=PA507&lpg=PA507&dq=ToolStripItemDesignerAvailability+attribute&source=bl&ots=hJLpeqQqrM&sig=3BoIynZA4rP-V55447AN8gON9KE&hl=nl&ei=2jO9Ss6TINvOjAfBoME4&sa=X&oi=book_result&ct=result&resnum=2#v=onepage&q=ToolStripItemDesignerAvailability%20attribute&f=false[^]

    Bad = knowing 2 much

    C# tutorial

  • how to add costum control to custom control via designer. [modified]
    N Natural_Demon

    wel, i'm trying to achieve, that items added to the menuStrip, are the items from my class and not the standart System.Windows.Forms.ToolStripMenuItem(). without anyneed to manualy moding the form1.designer.cs this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem1 = new OwnerDraw_Test_3.cToolStripMenuItem();

    Bad = knowing 2 much

    C# tutorial

  • how to add costum control to custom control via designer. [modified]
    N Natural_Demon

    i'm trying to create 2 custom controls, once you compile, you have a nice custom control up in the visualstudio I.D.E.. i would like to achieve, the once a dragged 'MenuStrip' onto my form and start adding item, that these items are also a new created costrum control 'cToolStripMenuItem', instead of standart item using System; using System.Collections.Generic; using System.Windows.Forms; using System.Text; namespace OwnerDraw_Test_3 { class CMenuStrip : MenuStrip { } class cToolStripMenuItem : ToolStripMenuItem { } } kind regards

    Bad = knowing 2 much

    modified on Thursday, September 24, 2009 2:41 PM

    C# tutorial

  • ownerdraw MenuStrip Adobe Cs4 lookalike, any voluntairs?
    N Natural_Demon

    hi, i'm trying to code a Adobe Cs4 lookalike menustrip. i found some material on microsoft's MSDN. i stripted this example to a proper visual studio 2008 project. if i apply the ... this.MenuStrip1.Renderer = new RolloverItemRenderer(); it does remove the border when you hover the the mouse over a parent menuItem and simply gives a blue background and white chars. i would like to override the hoover color + border and shape of the button. also this methode is hard to use, it would be cool if you can edit the custom draw menu from the designer and the need of event. so i think it need a totaloverhaul somehow. i have experience on other control, like tabcontrol, button, etc, etc. but it seems, this needs a diffferent aproach. any volunteers to code a cool costum menu? i can mail the project. http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripitem.aspx[^]

    Bad = knowing 2 much

    C# csharp visual-studio com adobe tutorial

  • How to make a Custom Textbox Controll caputure the Parent's clickEvent [modified]
    N Natural_Demon

    this is the whole class somehow 'SendMessage(...)' blocks it. move the 'MessageBox' 2 lines higher @ 'protected override void OnHandleCreated' and it gets triggered. put it baack below and it doesn't public partial class exTextBox : TextBox { public exTextBox() { SendMessage(this.Handle, EM_SETCUEBANNER, 0, this.WaterMarkText); } protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); //this.Parent.Click +=new EventHandler(Parent_Click); Parent.Click += new EventHandler(Parent_Click); // just for testing MessageBox.Show( "OnHandleCreated", "OnHandleCreated", MessageBoxButtons.OK, MessageBoxIcon.Information); } void Parent_Click(object sender, EventArgs e) { MessageBox.Show( "click", "click", MessageBoxButtons.OK, MessageBoxIcon.Information); } #region Attributes //[DefaultValue(typeof(String), "set the default value"), Category("Appearance"), Description("Set the default value.")] private const int EM_SETCUEBANNER = 0x1501; [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern Int32 SendMessage (IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); private string _waterMarkText = "Water Mark"; public string WaterMarkText { get { return _waterMarkText; } set { SendMessage(this.Handle, EM_SETCUEBANNER, 0, value); _waterMarkText = value; Invalidate(); } } #endregion public bool notempty() { if ((this.TextLength > 0) && (this.Text != this.WaterMarkText)) { base.BackColor = Color.White; return true; } else { base.BackColor = Color.Red; this.Text = this.WaterMarkText; return false; } } }

    Bad = knowing 2 much

    C# tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups