dcsimg
Page 65 of 65 FirstFirst ... 155562636465
Results 2,561 to 2,578 of 2578

Thread: CommonControls (Replacement of the MS common controls)

  1. #2561
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    2,020

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    It's the responsibility of the >>EXE<< to make such things. It would be ridicolous if an OCX overwrites VB functions without any control and with ASM hacks..
    What do you mean "without any control"?

    It works very well indeed.

    BTW: I updated the sample
    Last edited by Eduardo-; Yesterday at 01:30 AM.

  2. #2562

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,391

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Eduardo- View Post
    What do you mean "without any control"?

    It works very well indeed.

    BTW: I updated the sample
    It's NOT the job of the OCX to do that.

    Reapeating: It's the EXE responsibility to change fancy things.

    Quote Originally Posted by Darkbob View Post
    Well... that did change things. Now the whole IDE just closes and exits without any error message. But the demo still doesn't run.

    Just to make sure it wasn't just this new laptop I'm having troubles with I downloaded the demo and ran it on another computer. Identical result. Press Run and * poof * the IDE closes and exits. No error message. Just gone.

    Best of luck on what looks like a very powerful project with a lot of potential. I'll be sure to keep an eye on this thread and see what happens in future.
    Ok. Bye.
    Last edited by Krool; Yesterday at 01:55 AM.

  3. #2563
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    2,020

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    It's NOT the job of the OCX to do that.
    It is your component, you do whatever you want.

    But you cannot state it as a general rule, because it can be done and it works without problem.

    Quote Originally Posted by Krool View Post
    Reapeating: It's the EXE responsibility to change fancy things.
    Again, it is your opinion, your project, your decision.
    I thought it could be a good idea to offer that possibility, since your project mainly seems to be intended to upgrade VB6 bringing Unicode support to it (and other things), and leaving those intrinsic VB Functions in their ANSI version somewhat undermines the goal.
    I think for that reason you added them to the exe version.

    But if you are afraid that it could cause any problem, I understand.
    Or whatever reason that you have to think so.
    I just suggested it as a possibility, nothing more.
    I realize that you don't like contributions (or opinions).
    OK, no problem.

  4. #2564
    Addicted Member
    Join Date
    Jul 2017
    Posts
    207

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Darkbob View Post
    Last time I tried it the sample wouldn't load. I don't think they are really trying to make something people can use. Just tech types having fun I think.
    Try this . Add this manifest to your VB6.exe . I used ResourceHacker to update it .

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
          <application> 
            <!--This Id value indicates the application supports Windows Vista functionality -->
              <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> 
            <!--This Id value indicates the application supports Windows 7 functionality-->
              <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
            <!--This Id value indicates the application supports Windows 8 functionality-->
              <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
            <!--This Id value indicates the application supports Windows 8.1 functionality-->
              <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
          </application> 
      </compatibility>
      <assemblyIdentity type="win32" 
                        name="myOrganization.myDivision.mySampleApp" 
                        version="6.0.0.0" 
                        processorArchitecture="x86" 
                        publicKeyToken="0000000000000000"
      />
      <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                processorArchitecture="*"
                publicKeyToken="6595b64144ccf1df"
                language="*"
            />
        </dependentAssembly>
      </dependency>
      <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <windowsSettings>
            <dpiAware  xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
        </windowsSettings>
      </application>  
    </assembly>
    I am using the OCX version , and I always combine the following files to the project > Most of them are oriented to visual styles issue .
    1- VisualStyles.bas
    2- Common.bas
    3- Resource file and following is its content :

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
          <application> 
            <!--This Id value indicates the application supports Windows 8 functionality-->
              <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
          </application> 
      </compatibility>
      <assemblyIdentity type="win32" 
                        name="myOrganization.myDivision.mySampleApp" 
                        version="6.0.0.0" 
                        processorArchitecture="x86" 
                        publicKeyToken="0000000000000000"
      />
      <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                processorArchitecture="*"
                publicKeyToken="6595b64144ccf1df"
                language="*"
            />
        </dependentAssembly>
      </dependency>
      <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <windowsSettings>
            <dpiAware  xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
        </windowsSettings>
      </application>  
    </assembly>
    4- In each form_load event , add this line
    Code:
    SetupVisualStyles Me
    Last edited by Hosam AL Dein; Yesterday at 04:44 AM.

  5. #2565
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    367

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    Try this . Add this manifest to your VB6.exe . I used ResourceHacker to update it .

    ...

    I am using the OCX version , and I always combine the following files to the project > Most of them are oriented to visual styles issue .
    1- VisualStyles.bas
    2- Common.bas
    3- Resource file and following is its content :
    First, thanks very much for your suggestions. Very helpful. I realize it's not your job to spoon feed me so I'll try to figure out how to add a manifest to VB6. Last time I tried... it didn't end well. But I'm up for another try. But any idea where a person would find VisualStyles.bas and Common.bas?

  6. #2566
    Addicted Member
    Join Date
    Jul 2017
    Posts
    207

    Re: CommonControls (Replacement of the MS common controls)

    Don`t mention it .
    But any idea where a person would find VisualStyles.bas and Common.bas?
    . Download the demo found in the first page of this thread . You will find them in the Common folder .

    Now you have the most recent version of VBCCR controls . The function SetupVisualStyles I mentioned above is updated to SetupVisualStylesFixes . (I have not yet upgraded to the latest version therefore I wrote the name I am still using) . See this post http://www.vbforums.com/showthread.p...=1#post5444619 .

    About Manifesting VB6 Exe , Download ResourceHacker . File > Open .. Browse for VB6.Exe > Open the Manifest node > delete all text > Paste the text provided above > Press the green arrow button Compile Script Then save it > Replace the old VB6.exe with this one . That`s it .

    Keep your old VB6.Exe in the same directory with another name in case of any failure . If you encountered permission error saving the new exe in this location , then save it in any other location then copy>paste it manually . Start IDE , you will notice that it is themed (If everything is ok) . One clear sign for that is you will not find any colors in the palette tab while setting the back color - (or any property dealing with colors) - property of any control from properties window .

  7. #2567
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    2,020

    Re: CommonControls (Replacement of the MS common controls)

    There is a bug in the LabelW control in the DoAutoSize procedure.

    The line:
    Code:
    .Extender.Move .Extender.Left, .Extender.Top, .ScaleX((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2), vbPixels, vbContainerSize), .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
    Should be changed to:
    Code:
    If PropWordWrap = True Then
        .Extender.Move .Extender.Left, .Extender.Top, .Extender.Width, .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
    Else
        .Extender.Move .Extender.Left, .Extender.Top, .ScaleX((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2), vbPixels, vbContainerSize), .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
    End If

  8. #2568
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    367

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    About Manifesting VB6 Exe , Download ResourceHacker . File > Open .. Browse for VB6.Exe > Open the Manifest node >
    Humm... No manifest node... Any ideas?

  9. #2569
    Addicted Member
    Join Date
    Jul 2017
    Posts
    207

    Re: CommonControls (Replacement of the MS common controls)

    Sorry , I produced the steps above by opening a manifested exe while in your case it is not . So , yes , you will not find this node as your exe is still not manifested yet .

    Anyway ,
    Action > Add from blank script > ((then a clean window opens - paste the manifest text in there )) > Compile green button > Save

  10. #2570
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,730

    Re: CommonControls (Replacement of the MS common controls)

    You don’t have to embed the manifest (I would advise against modifying vb6.exe in any way). Just place the .manifest file next to the .exe file and restart the OS. The last step is required for the manifest cache to be cleared and is usually not heeded and then someone declares in the forums external manifest is not working.

    You can clear the manifest cache for vb6.exe by changing its last modified date with touch.exe utility or similar too.

  11. #2571
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    2,020

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by wqweto View Post
    You don’t have to embed the manifest (I would advise against modifying vb6.exe in any way).
    Why?

  12. #2572
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    367

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Hosam AL Dein View Post
    Action > Add from blank script > ((then a clean window opens - paste the manifest text in there )) > Compile green button > Save
    Ah! Well.. that seems to work. But just a question... what does this all do?

    In my case I did notice the IDE showed a few minor changes to bold text but not much else.

    The only thing I noticed on my own existing VB project was that the background color for the drop-down combo box changed from green to light grey. Not sure why that would happen.

    Is there some benefit I'm not seeing? Or does the benefit only happen when you start using the replacement controls?

  13. #2573
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    367

    Re: CommonControls (Replacement of the MS common controls)

    OMG it works. The demo actually works!!! Hosan Al Dein showed the way with his brilliant post about adding a manifest into the VB6.EXE file... and presto. The demo finally works! Might be an idea to edit post #1 and add this info. Now I can finally see what you guys are talking about.

    Name:  working.jpg
Views: 28
Size:  32.2 KB
    Last edited by Darkbob; Today at 11:29 AM.

  14. #2574
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,730

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Eduardo- View Post
    Why?
    Because it's not needed. Why would I want to modify the compiler just to run the IDE manifested if I don't have to?

    Of course vb6.exe is not digitally signed nor is it a protected OS file so there are no "defenses" against corrupting it yourself at will.

    Why does Resource Hacker always create a backup file next to the modified executable? Obviously fiddling w/ PE files this is not as reliable as adding/removing "resources" to a .zip file -- never seen 7-zip creating backup files when modifying an archive.

    cheers,
    </wqw>

  15. #2575
    Member dseaman's Avatar
    Join Date
    Oct 2004
    Location
    Natal, Brazil
    Posts
    33

    Re: CommonControls (Replacement of the MS common controls)

    Several years ago I used an embedded Vb6.exe Manifest until I managed to corrupt Vb6 after a fresh install of Windows.
    Since then I always use an external Manifest "Vb6.exe.manifest".
    I did have to make a registry change so that it is recognized.

    Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide
    Value(REG_DWORD): PreferExternalManifest
    Data: 1 = prefer, 0 = don't prefer

  16. #2576
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,991

    Re: CommonControls (Replacement of the MS common controls)

    --

    A .Refresh on the status bar wipes out the text. That doesn't seem correct.

    I'm just using it as a single StatusBar, and using the SimpleText property.

    I'm also using the source code version, and just including it in my project.

    Here's the code I originally had:

    Code:
    
    Public Sub UndoChanges()
        ' Careful, FilePath and FileName shouldn't be undone.
        '
    
    
        If miUndoCount = 0& Then
            SetStatus "There are no remaining undo points."
            Sleep 200
            SetStatus "There are no remaining undo points."
            Sleep 200
            SetStatus "There are no remaining undo points."
            Sleep 200
            SetStatus "There are no remaining undo points."
            Exit Sub
        End If
        '
    
    
    
    
    End Sub
    
    
    
    
    Public Sub SetStatus(sText As String):
        StatusBar.SimpleText = " " & sText
        StatusBar.Refresh
    End Sub
    
    

    I just wanted it to blink a bit.

    If I comment out the StatusBar.Refresh line, the text doesn't get cleared, but I don't get my blink.

    -----

    Actually, I was hoping for a .ForeColor (or maybe .FontColor), so I could blink it red, but that wasn't an easy option.

    But I suspect, even with that, I'd still have a problem making it blink, which I want.

    --------

    EDIT1: Ok, I was being a bit dense. I needed something like the following to get my blink.

    Code:
    
        If miUndoCount = 0& Then
            SetStatus "There are no remaining undo points."
            Sleep 200
            SetStatus vbNullString
            Sleep 200
            SetStatus "There are no remaining undo points."
            Sleep 200
            SetStatus vbNullString
            Sleep 200
            SetStatus "There are no remaining undo points."
            Sleep 200
            SetStatus vbNullString
            Sleep 200
            SetStatus "There are no remaining undo points."
            Sleep 200
            SetStatus vbNullString
            Sleep 200
            SetStatus "There are no remaining undo points."
            Exit Sub
        End If
    
    
    And that actually worked, blink and all.

    I think my question still stands though. A .Refresh is suppose to clear the text?
    Last edited by Elroy; Today at 02:46 PM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  17. #2577
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,730

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by dseaman View Post
    I did have to make a registry change so that it is recognized.
    My point exactly: *this* is the kind of cargo-culting in this thread that my duty called. . .



    No need to change this reg key. Just create the the vb6.exe.manifest and then restart the OS :-))

    cheers,
    </wqw>

  18. #2578

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,391

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Elroy View Post
    Actually, I was hoping for a .ForeColor (or maybe .FontColor), so I could blink it red, but that wasn't an easy option.

    I think my question still stands though. A .Refresh is suppose to clear the text?
    When using .Style = Normal you can use the .Panels(Index).ForeColor property.

    A .Refresh should erase the text? I can't replicate such thing.

    Quote Originally Posted by Eduardo- View Post
    There is a bug in the LabelW control in the DoAutoSize procedure.
    Thanks, your right. Update released.

    Quote Originally Posted by Darkbob View Post
    OMG it works. The demo actually works!!! Hosan Al Dein showed the way with his brilliant post about adding a manifest into the VB6.EXE file... and presto. The demo finally works! Might be an idea to edit post #1 and add this info. Now I can finally see what you guys are talking about.

    Name:  working.jpg
Views: 28
Size:  32.2 KB
    The demo should also works without manifest. At least it does for me.

    Name:  ComCtlsDemoNoManifest.jpg
Views: 11
Size:  55.1 KB

Page 65 of 65 FirstFirst ... 155562636465

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width