Saturday, May 8, 2010

TIPS: Issues while compiling WXWidgets

If you have msys installed & added to the path then WxWidgets failes to compile and you will get the error which starts as follows

if not exist gcc_mswd mkdir gcc_mswd


The easiest solution to resolve is in the command prompt remove all the path folders except windows & mingw paths and then try to recompile in the same command window.

Thursday, May 6, 2010

TIPS: Most Important Calls From The RunDll32.exe & Shell32.Dll ...

Most Important Calls From The RunDll32.exe & Shell32.Dll ...

RUNDLL32.EXE shell32,SHFormatDrive',sw_normal

Module Command Result
main.cpl rundll32.exe shell32.dll,Control_RunDLL main.cpl @2 displays the Printers Folder (including Add Printer
rundll32.exe shell32.dll,Control_RunDLL main.cpl @3 displays the Fonts Folder in Explorer view
rundll32.exe shell32.dll,Control_RunDLL main.cpl @ displays Power Management Properties
Modem.cpl rundll32.exe shell32.dll,Control_RunDLL modem.cpl,,add Runs the Add New Modem wizard
Mmsys.cpl rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0 displays the Multimedia/Audio property page
rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,1 displays the Multimedia/Video property page
rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,2 displays the Multimedia/MIDI property page
rundll32.exe shell32.dll,Control_RunDLLmmsys.cpl,,3 Multimedia/CD Music property page
rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,4 displays the Multimedia/Advanced property pag
rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @1 displays the Sound Properties page
Netcpl.cpl rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl displays the Networks properties, Configuration tab
Odbccp32.cpl rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl displays the ODBC32 Data Source Administrator propertie
Shell32.dll rundll32.exe shell32.dll,OpenAs_RunDLL {drive:\path\filename} displays the application/file "Open With" dialog
Password.cpl rundll32.exe shell32.dll,Control_RunDLL password.cpl displays the Passwords properties, Change Passwords tab
Powercfg.cpl rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl displays the Power Management properties, Power Schemes tab
Intl.cpl rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,0 displays the Regional Settings property page
rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,1 displays the Numbers property page
rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,2 displays the Currency property page
rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,3 displays the Time property page
rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,4 displays the Date property page
Divers RUNDLL.EXE rnaui.dll,RnaWizard Dial-Up Network connection wizard
RUNDLL.EXE shell,shellexecute Open Explorer window
sysdm.cpl,InstallDevice_Rundll Hardware Installation wizard
RUNDLL.EXE user,cascadechildwindows Cascade all windows
RUNDLL.EXE user,MessageBeep default beep sound
RUNDLL.EXE user,repaintscreen same as F5 in an Explorer window
RUNDLL.EXE user,setcursorpos cursor is set to the upper left
RUNDLL.EXE user,SwapMouseButton swapping mouse buttons
RUNDLL.EXE user,tilechildwindows Tile all windows
RUNDLL.EXE user,wnetconnectdialog Map Network drive
RUNDLL.EXE user,wnetdisconnectdialog Unmap Network drive
RUNDLL.EXE user,ExitWindows Exit Windows
RUNDLL.EXE user,ExitWindowsExec Restart Windows
RUNDLL32.EXE rnaserv,CallerAccess start Dial-Up Server
RUNDLL32.EXE shell32,Control_RunDLL start Control Panel
RUNDLL32.EXE shell32,Control_RunDLL X "X" = any CPL filename
RUNDLL32.EXE shell32,OpenAs_RunDLL "Open with" dialog box
RUNDLL32.EXE shell32,ShellAboutA About in an Explorer window
RUNDLL32.EXE shell32,SHExitWindowsEx X Exit Windows, where these values apply for X:
1: Exit Windows
2: Reboot PC
4: Close all applications
8: Exit Win and turn-off ATX-compatible PC
0: Restart Windows shell
-1: Restart Explorer
RUNDLL32.EXE shell32,SHFormatDrive "Format Disk" dialog box
RUNDLL.EXE krnl386.exe,exitkernel Exit Windows without prompting

Friday, April 9, 2010

Tips: wx.Python: Animated Gif in

import wx

import wx.animate # ..\wx\animate.py

class MyPanel(wx.Panel):

""" class MyPanel creates a panel, inherits wx.Panel """

def __init__(self, parent=None):


wx.Panel.__init__(self, parent)


self.SetBackgroundColour("white")


ag_fname = r"progress.gif"


self.ag = wx.animate.GIFAnimationCtrl(self, -1, ag_fname, pos=(0, 0), size=(64,64))


self.ag.GetPlayer().UseBackgroundColour(True)


self.ag.Play()


#self.ag.Stop()



if __name__ == '__main__':

app = wx.App(redirect = 0)


frame = MyPanel(None)


frame.Show(True)


app.SetTopWindow(frame)


app.MainLoop()


Friday, March 26, 2010

Tips: Python: Switch in Python

################################################################

# There is no 'Switch' statement in Python, but we can use the following example to simulate switch case.

# We can use dictionary in python to simulate the switch case

################################################################

def f1():

print("Hello f1")

def f2():

print("Hello f2")

funcdict = {

0: f1,

1: f2

}

selection = 1

funcdict.get(selection)()

Tips: Python: Switch in Python

################################################################

# There is no 'Switch' statement in Python, but we can use the following example to simulate switch case.

# We can use dictionary in python to simulate the switch case

################################################################

def f1():

print("Hello f1")

def f2():

print("Hello f2")

funcdict = {

0: f1,

1: f2

}

selection = 1

funcdict.get(selection)()

Tuesday, March 9, 2010

Tips: Python: How to get the full username in Windows

import win32com,win32com.client,pythoncom

sDomain ="ES"

sUser ="johrim"

sADSPath= sDomain + sUser

oUser=win32com.client.GetObject("WinNT://%s,user" % sADSPath )

print (oUser.FullName)

Monday, March 8, 2010

Tips: VBScript: Get Full NT User Name using VBScript

Set oNetwork = CreateObject("WScript.Network")
sDomain = "test"
sUser = "johri"
sADSPath= sDomain & "/" & sUser
Set oUser = GetObject("WinNT://" & sADSPath & ",user")
WScript.Echo oUser.FullName

Saturday, March 6, 2010

Tips: Python : wxFormBuilder v3.1.67-beta (Febuary 18, 2010) Python Update

Latest version of wxFormBuilder does not support wxAdditions fully, thus I have updated few XML files to support FlatNotebook & wx.propgrid widgets.

  1. Download wx.propgrid and install it.

  2. Download the XML.Zip folder and extract it in plugins\wxAdditions\xml folder.

  3. Restart the wxformbuilder.


I did not tried to update these files for other widgets but it should be similar.

Thursday, February 25, 2010

Tips: Video: convert mov to avi file using ffmpeg

Use the following command to convert .mov file to .avi file.
ffmpeg -i file-name.mov -g 60 -vcodec msmpeg4v2 -acodec pcm_u8 -f avi file-name.avi

Friday, February 19, 2010

Tips: MSI: Save differences between two msi as MST file using ruby & python

Ruby
require 'win32ole'
msiClass = WIN32OLE.new("WindowsInstaller.Installer")
msidb = msiClass.OpenDatabase("C:\\temp\\MountPointGenerator.msi",0)
newmsidb = msiClass.OpenDatabase("C:\\temp\\updatedMountPointGenerator.msi",0)
transform = newmsidb.GenerateTransform(msidb,"c:\\temp\\newtest.mst")

Python
import win32com.client
import os
import sys


msiOpenDatabaseModeReadOnly=0
msidb=r"c:\temp\MountPointGenerator.msi"
msiupdb=r"c:\temp\updatedMountPointGenerator.msi"
mstdb=r"C:\temp\MNPtrans.mst"


installer = win32com.client.Dispatch("WindowsInstaller.Installer")
database = installer.OpenDatabase(msidb, msiOpenDatabaseModeReadOnly)
updatedDB= installer.OpenDatabase(msiupdb , msiOpenDatabaseModeReadOnly)
updatedDB.GenerateTransform(database, mstdb)