Vai al contenuto



Foto

Chi Può Buildare Un Modulo M-shell?


  • Per favore accedi per rispondere
2 risposte a questa discussione

#1 OFFLINE   madhacker

madhacker

    Senior Member

  • Utente
  • StellettaStellettaStellettaStellettaStelletta
  • 527 messaggi
  • Cellulare:N95-2,5800

Inviato 02 luglio 2009 - 18:47

come da titolo chiedo gentilmente se c'è qualcuno che potrebbe compilare in c++ un modulo per m-shell.
allego il sorgente. spero che ci sia qualcuno di buona volontà che possa fare la felicità di molti possessori di m-shell.

vi chiedo questo perchè io riesco con successo a compilare i moduli, ma quando li provo in mshell, mi da diversi errori.

#include <NativeModule.h>

// link also in MMP: eikcore.lib cone.lib apgrfx.lib ws32.lib
#include <eikenv.h> 
#include <apgwgnam.h>

class EnvyModule : public NativeModule 
	{
private:
	enum
	{
	Hidden,
	System
	};

protected:
	TInt ExpectedRuntimeVersion()
		{ 
		return Runtime::VERSION; 
		}

	const char *ModuleVersion() { return "$Revision: 806 $"; }

	void ConstructL()
		{
		runtime->AddNativeFunctionL(_L("hide"), 0, 0, Hidden);
		runtime->AddNativeFunctionL(_L("system"), 0, 0, System);
		}

	Runtime::Value ExecuteL(TInt index, Runtime::Value *params,
			TInt paramCount, TRequestStatus &status)
		{

		Runtime::Value result;

		switch (index)
			{
			case Hidden:
				{
				TInt wgId = CEikonEnv::Static()->RootWin().Identifier();
				RWsSession session = CEikonEnv::Static()->WsSession();
				CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(session, wgId);
				wgName->SetHidden(ETrue);
				wgName->SetWindowGroupName(CEikonEnv::Static()->RootWin());
				CleanupStack::PopAndDestroy(); // wgName
				result.SetNull();
				break;
				}
			case System:
				{
				CEikonEnv::Static()->SetSystem( ETrue );
				result.SetNull();
				break;
				}
			}
		return result;
		}
	};

EXPORT_C NativeModule* NewEnvyModuleL() 
		{
		return new (ELeave) EnvyModule;
		}

Download file



#2 OFFLINE   dany666

dany666

    Member

  • Utente
  • StellettaStelletta
  • 20 messaggi
  • Cellulare:n82

Inviato 06 ottobre 2009 - 18:38

credo che aggiungendo al modulo questa funzione si possa nascondere l'icona....

IMPORT_C void CAknAppUi::HideApplicationFromFSW (TBool aHide=ETrue) ;

#3 OFFLINE   foxjv

foxjv

    Newbie

  • Utente
  • Stelletta
  • 4 messaggi
  • Cellulare:5800XM
  • Firmware:52.0.101

Inviato 18 novembre 2012 - 17:04

come da titolo chiedo gentilmente se c'è qualcuno che potrebbe compilare in c++ un modulo per m-shell.
allego il sorgente. spero che ci sia qualcuno di buona volontà che possa fare la felicità di molti possessori di m-shell.

vi chiedo questo perchè io riesco con successo a compilare i moduli, ma quando li provo in mshell, mi da diversi errori.

#include <NativeModule.h>

// link also in MMP: eikcore.lib cone.lib apgrfx.lib ws32.lib
#include <eikenv.h>
#include <apgwgnam.h>

class EnvyModule : public NativeModule
	{
private:
	enum
	{
	Hidden,
	System
	};

protected:
	TInt ExpectedRuntimeVersion()
		{
		return Runtime::VERSION;
		}

	const char *ModuleVersion() { return "$Revision: 806 $"; }

	void ConstructL()
		{
		runtime->AddNativeFunctionL(_L("hide"), 0, 0, Hidden);
		runtime->AddNativeFunctionL(_L("system"), 0, 0, System);
		}

	Runtime::Value ExecuteL(TInt index, Runtime::Value *params,
			TInt paramCount, TRequestStatus &status)
		{

		Runtime::Value result;

		switch (index)
			{
			case Hidden:
				{
				TInt wgId = CEikonEnv::Static()->RootWin().Identifier();
				RWsSession session = CEikonEnv::Static()->WsSession();
				CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(session, wgId);
				wgName->SetHidden(ETrue);
				wgName->SetWindowGroupName(CEikonEnv::Static()->RootWin());
				CleanupStack::PopAndDestroy(); // wgName
				result.SetNull();
				break;
				}
			case System:
				{
				CEikonEnv::Static()->SetSystem( ETrue );
				result.SetNull();
				break;
				}
			}
		return result;
		}
	};

EXPORT_C NativeModule* NewEnvyModuleL()
		{
		return new (ELeave) EnvyModule;
		}


visita questo sito

Please Login HERE or Register HERE to see this link!


a me è stato utile....