10 Replies - 1158 Views - Last Post: 24 December 2012 - 12:22 PM Rate Topic: -----

#1 Neph1x  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 110
  • Joined: 19-November 11

How to disable AERO with VB08

Posted 24 December 2012 - 06:08 AM

Hey!
Please can you help me how to disable Aero with visual basic application?
Exp/ I have button and when i click od it, that will disable aero!

Thank you!
Sorry for bad Enlhish.


Merry Christmas and Happy New Year
Is This A Good Question/Topic? 0
  • +

Replies To: How to disable AERO with VB08

#2 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: How to disable AERO with VB08

Posted 24 December 2012 - 10:26 AM

View PostNeph1x, on 24 December 2012 - 07:08 AM, said:

Please can you help me how to disable Aero with visual basic application?
Exp/ I have button and when i click od it, that will disable aero!


Have a look at this MSDN forum article.
Was This Post Helpful? 0
  • +
  • -

#3 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,499
  • Joined: 16-March 11

Re: How to disable AERO with VB08

Posted 24 December 2012 - 10:28 AM

Are you referring to Windows Aero Forms? or Windows Aero style in general?
Was This Post Helpful? 0
  • +
  • -

#4 Neph1x  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 110
  • Joined: 19-November 11

Re: How to disable AERO with VB08

Posted 24 December 2012 - 10:41 AM

Windows Aero style
Was This Post Helpful? 0
  • +
  • -

#5 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,499
  • Joined: 16-March 11

Re: How to disable AERO with VB08

Posted 24 December 2012 - 11:36 AM

Alright well you need to understand that disabling it with an application disables the whole theme, not just for your application. So we begin with a little api. We need to map a function from the dwmapi.dll.


    <DllImport("dwmapi.dll", PreserveSig:=False)> _
    Public Shared Sub DwmEnableComposition(bEnable As Boolean)
    End Sub



then to use it you use this

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        DwmEnableComposition(False)
    End Sub



This should successfully disable the theme.
Was This Post Helpful? 1
  • +
  • -

#6 Neph1x  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 110
  • Joined: 19-November 11

Re: How to disable AERO with VB08

Posted 24 December 2012 - 12:01 PM

Dude, thank you very much! but i still have a little problem!
When i copy>paste this i get this error

"Type 'DllImport' is not defined."

Posted Image
Was This Post Helpful? 0
  • +
  • -

#7 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,499
  • Joined: 16-March 11

Re: How to disable AERO with VB08

Posted 24 December 2012 - 12:01 PM

When working with DLL Declarations like that you have to import the System.Runtime.InteropServices namespace.
Was This Post Helpful? 1
  • +
  • -

#8 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2240
  • View blog
  • Posts: 9,411
  • Joined: 29-May 08

Re: How to disable AERO with VB08

Posted 24 December 2012 - 12:12 PM

Or write
 <System.RunTime.InteropServices.DLLImport("dwmapi.dll", PreserveSig:=False)> 

This post has been edited by AdamSpeight2008: 24 December 2012 - 12:12 PM

Was This Post Helpful? 1
  • +
  • -

#9 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,499
  • Joined: 16-March 11

Re: How to disable AERO with VB08

Posted 24 December 2012 - 12:12 PM

Thanks Adam, that's simpler for me.
Was This Post Helpful? 1
  • +
  • -

#10 Neph1x  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 110
  • Joined: 19-November 11

Re: How to disable AERO with VB08

Posted 24 December 2012 - 12:18 PM

"My" version!
Imports System.Runtime.InteropServices

Public Class TestMo
<DllImport("dwmapi.dll", PreserveSig:=False)> _


and it works!

Thank you!!

Merry Christmas and Happy New Year
Was This Post Helpful? 0
  • +
  • -

#11 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,499
  • Joined: 16-March 11

Re: How to disable AERO with VB08

Posted 24 December 2012 - 12:22 PM

Merry Christmas sir.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1